Fear and loathing of the "perification" of Smalltalk

Damien Pollet damien.pollet at gmail.com
Tue Sep 4 22:24:07 UTC 2007


On 04/09/07, Bert Freudenberg <bert at freudenbergs.de> wrote:
> >>     "Same as using curly braces but importantly NO syntax changes
> >> needed!"
> >>     list := [a. b. c] objects.
> >
> > But  a. b. c  is a sequence that evaluates to the result of c. How can
> > the block see a and b without doing dirty tricks accessing its own
> > source code ?
>
> "[a. b. c]" is just a block defining a sequence of statements. The
> value depends on how you evaluate that block - sending #value only
> retains the last value, but you could as well define another
> evaluation strategy by sending another message.

But that involves VM and semantics changes that are far more heavier
than just adding syntactic sugar... To me a. b. c really means
"evaluate a then b then c and return the result of c". If you change
that then you have to
 - explain that period has different semantics depending on the context (*),
 - make it possible to define new evaluation semantics for blocs (why
two and not more)
 - fix the block optimisations, because now they are just sequences of
expressions with undefined a-priori semantics

etc etc etc

(*) just on this point I'd prefer to write something like
{[a]. [:x| x b]. [:x | x c]} valueAsChain

-- 
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org



More information about the Squeak-dev mailing list