Compile Time Constants

Eric Arseneau eat at huv.com
Sat Jun 17 05:29:15 UTC 2000


> I miss them too, but they were being actively discouraged by the
> IBM Smalltalk team recently due to problems with portability to
> certain platforms. (I suspect that the 'certain platform' was our
> old buddy MVS but there may be problems porting to other platforms too.)
That seems odd, but it may be that not all objects are valid in a CTC.
Something like an OSPtr is not something one should find in there.  Plus,
the VA cross compilation may have a problem, it may not want to
"re-evaluate" the CTC in order to have the objects be created in whatever
form they are needed for the destination environment.

> BTW,  that expression can be written as:
>
> 	^number bitAnd:  16rFFFF
>
> which is clearly four sets of 4-bit digits, 16 bits of one-bits,
> and the operation is clearly masking off the right 16 bits of
> number. I find it clearer, but tastes vary and not everybody does.
Thank you, I had forgotten that showing it this way would be just as clean.
It works for me, I'm just to used to expressing it the other way.

> On one hand they allow compile time evaluation of code that
> doesn't change at run time, and on the other they expose terrible
> monstrosities when, say, used to evaluate something that holds
> system memory for operating system functions.
As in all good things, abuse can exist no matter what we do.  I prefer to
educate proper usage and provide the power, rather than handicap developers
who could put it to good use.





More information about the Squeak-dev mailing list