Will squeak ever support compile-time evaulation?
Hans-Martin Mosner
hmm at heeg.de
Wed Feb 13 10:31:07 UTC 2002
Chris Muller wrote:
> VisualAge supports a non-standard Smalltalk syntax
> element for compile-time evaluation of methods, useful
> for balancing intention-revealing code and
> performance. For example:
>
> bitMultipliers
> ^##((1 to: 128) collect: [ :factor | (256 raisedTo:
> factor) - 1 ])
>
I see no big advantage over class variable initialization, but there are
some disadvantages:
1. It's incompatible to other Smalltalks (well, so is {}...)
2. For binary storage of methods, you need to decide whether
it should be re-evaluated when the code is loaded into an image.
I could list some more (minor ones) but I think you get the idea.
So, I prefer class variables with initialization.
Cheers,
Hans-Martin
More information about the Squeak-dev
mailing list
|