About whileTrue:

Avi Bryant avi.bryant at gmail.com
Sun Feb 19 09:38:57 UTC 2006


On Feb 19, 2006, at 1:34 AM, stéphane ducasse wrote:
>
> Now my question:
>
> it seems that the code of whileTrue: should not be run at all  
> contrary to the
> one of VisualWorks "This method is inlined if both the receiver and  
> the argument are literal
> blocks. In all other cases, the code above is run.".
> I understand that in VW
> 	self value
> 		ifTrue:
> at least allows to escape the endless loops.
> Else if the code is run how does it get rid of the block creation  
> [self value].

Because [self value] is a literal block (as is [aBlock value]), and  
so the #whileTrue: send inside the #whileTrue: implementation does  
get inlined, and there's no recursion.

Avi


More information about the Squeak-dev mailing list