Iterators? (Was: Squeak practical use? ...)

Andrew C. Greenberg werdna at mucow.com
Thu Jan 31 04:49:28 UTC 2002


Not only that -- how, exactly, is this continuation example an example 
of a tail recursion?  Certainly, its been decades since my A-exams, but 
as I recall, a tail recursion is generally defined as a recursive call 
in a tail context.  This is neither.  And while I understand the notion 
of "mutual tail recursions," I'm not sure what optimizations are 
proposed here (or even possible.

foo1: aParm

	self doSome
	^self foo2: anExpression

foo2: aParm
	self SomeMore
	^self foo1: anExpression

How, exactly, can I safely and in straightforward manner optimize this 
for any Class, when the definitions of foo1 and foo2 may well depend 
upon definitions in subclasses, which in turn may change?  Moreover, 
since these kinds of expressions can be horribly complex, I would HATE 
if the debugger lost contexts when showing me the problem.

In short, while I appreciate the virtue of recursion -- my observation 
is that TAIL recursion semantically equates to a straightforward 
iteration, I think, by definition.  These other traits, at least with 
the definition I was using, are not precisely tail recursions.

On Wednesday, January 30, 2002, at 11:19 PM, Tim Rowledge wrote:

> Scott A Crosby <crosby at qwes.math.cmu.edu> is claimed by the authorities 
> to have written:
>
>>
>> foo: x ifSucces: succBlock ifFail: failBlock
>>    blah1 ifTrue: [ ^succBlock value ]
>>    blah2 ifTrue: [ ^failBlock value ]
>>    succBlock := [ blah . [^sucBlock value]]
> Improper code I'm afraid. Can't assign to a parameter.
>
> tim
>
> --
> Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
> Strange OpCodes: HALT: No-Op
>
>




More information about the Squeak-dev mailing list