6 Jan 2001 05:21
Re: ["BUG"][FIX?]Incorrect Pseudo-Codefor#whileTrue:/#whileFalse:?
Bob Arning <arning <at> charm.net>
2001-01-06 04:21:22 GMT
2001-01-06 04:21:22 GMT
Hi Mark, On Fri, 05 Jan 2001 21:45:29 -0600 Mark van Gulik <ghoul6 <at> home.net> wrote: >On a hunch I tried stepping through this in the debugger. As I suspected, >it failed on the *second* call to jumpTo:. That's not the only problem. The version I sent also fails for larger iteration counts. Below are several variations that do not suffer that problem. The one I like best from the readability perspective is #whileTrue4:, although it is not the fastest of the bunch. Cheers, Bob -----code follows----- 'From Squeak2.9alpha of 17 July 2000 [latest update: #3231] on 5 January 2001 at 11:15:57 pm'! "Change Set: blockJump Date: 4 January 2001 Author: Bob Arning Experimental implementation of #whileTrue: using Mark van Gulik's GOTO trick. Several flavors are tried and timings for all are compared. The result are implementations that does not require compiler optimization and may cause less confusion."! !ContextPart methodsFor: 'instruction decoding' stamp: 'RAA 1/5/2001 23:04'! jumpTo: newPC stack: newSP self stackp: newSP. "remove any extra" ^pc _ newPC! !(Continue reading)
RSS Feed