[ENH][EXPERIMENTAL] Read only globals (was RE: Stability of Squeak)
Andreas Raab
Andreas.Raab at gmx.de
Wed Aug 15 20:55:30 UTC 2001
Stephen,
> I would only add the ability explicitly make a variable binding
> read-only, or writeable:
>
> (Smalltalk at: OrderedCollection) beReadOnly
> (Smalltalk at: OrderedCollection) beWriteable
>
> ...oops, but that won't work unless you recompile all stores into the
> binding. Perhaps you could do something at the bytecode level that
> would detect that you need actually send #value: to the binding (which
> would then dump out of the bytecode with a normalSend.
Not a good idea. The test in the bytecode would be quite expensive and so
I'd just recompile all the methods referring to the literal itself. In the
end changing a global between readwrite and readonly is something that will
happen quite rarely, and is going to be slow anyways (since the change of
the association requires #becoming the old and the new one).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|