Thanks Bert!

The byte code has the answer, I thought that the byte code will map the source code but I see that's not the case, probably to ensure some optimizations.. or to do that "jump" I don't know how to do that in smalltalk

Thanks a lot for taking the time to answer such a newbie question.

Erlis

On Tue, Oct 4, 2011 at 12:57 PM, Bert Freudenberg <bert@freudenbergs.de> wrote:
On 04.10.2011, at 18:41, Erlis Vidal wrote:

Can I add methods to literal blocks?

Yes.

Where do I implement those methods?

In class BlockClosure.


In case your answer is in BlockClosures, why I don't see any ifTrue: in the while implementation?

Because the compiler generates a jump byte code for whileTrue: directly. In a browser on the whileTrue: method, click the "source" button to switch to showing byte codes.

- Bert -



_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners