Will squeak ever support compile-time evaulation?

Chris Muller afunkyobject at yahoo.com
Wed Feb 13 06:18:41 UTC 2002


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 use this Array of pre-calculated numbers to assist
me in putting unsigned integers up to 128 bits into
ByteArray's much more quickly than if I calculated the
multiplier each time.

By using this notation in VA, when you save the
method, VA evaluates the code inside the ##( ... ) and
neatly caches the resulting Array directly in the
CompiledMethod, saving the need to create variables or
dipping into murky pool dictionaries.

Does anyone think this feature would be feasible for
Squeak?


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com



More information about the Squeak-dev mailing list