[self-interest] Re: Self for Squeak
David P Harris
dpharris at telus.net
Wed Aug 31 17:28:14 UTC 2005
Jecel Assumpcao Jr wrote:
>David P Harris wrote on Wed, 31 Aug 2005 09:50:26 -0700
>>Hey, nice! I am confused re the use of .... as in:
>>parent* = [( |
>>b = .
>>sum = (^ a+b).
>>ifTrue: b1 ifFalse: b2 = ( ^ b1 value ) | )].
>>a = .
>>Are they just syntactical?
>It took me a little while to figure them out too even though one of the
>presentations explains them. The idea is that whatever is inside the
>[...] gets compiled, evaluated and then the result is what is used in
>the main compiled code. The reason we don't need this in Self is because
>there is a magical rule saying "slot initialization expressions are
>evaluated in the context of the lobby instead of the object being
>compiled". This has no effect on the syntax but changes the semantics
>significantly, though in a way that is intuitive enough that we don't
>even notice it.
Umm, thanks for mentioning this, as I had not know/had forgotten about
the magical rule!
>The advantage of an explicit mechanism instead of a magical rule is that
>you get more flexibility. In Agora you use ' in front of a message name
>to have it evaluated at compile time. Normal Forth also uses [...] to
>switch to "interpret mode" and back while ColorForth uses different
>colors (green compiles, yellow interprets).
Yes, I am familiar with the Forth use, nice.
Seems that this plus Tweak and/or reformed Morphic will make a very nice
More information about the Self-interest