Equality of Recursive Structures [Was: Closure Compiler in 3.9
?]
Lukas Renggli
renggli at gmail.com
Fri May 11 18:49:37 UTC 2007
> > But then, what to deal with such cases:
> >
> > aClass>>add: a with: b
> > ^ self add: a with: b+1
>
> This is a call in tail position, and it's a crying shame that the Squeak
> VM doesn't presently allow the associated degenerate stack frames to be
> elided.
There is a reason why this is not done in Smalltalk. Have a look at
the examples below:
aClass>>add: a with: b
b = 0 ifTrue: [ SomeGlobal := thisContext ].
^ self add: a with: b+1
aClass>>add: a with: b
self become: #zork.
^ self add: a with: b+1
aClass>>add: a with: b
self class removeSelector: #add:with:.
^ self add: a with: b+1
There is an infinite number of other examples.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the Squeak-dev
mailing list
|