[ENH][EXPERIMENTAL] Read only globals (was RE: Stability of Squeak)

Stephen Pair spair at advantive.com
Wed Aug 15 11:35:25 UTC 2001


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.

- Stephen

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Andreas Raab
> Sent: Wednesday, August 15, 2001 2:42 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: [ENH][EXPERIMENTAL] Read only globals (was RE: 
> Stability of Squeak)
> 
> 
> Richard,
> 
> > It must be acknowledged that a programming language where
> > you can do
> >	Smalltalk keys do: [:k| Smalltalk at: k put: nil]
> > (which reliably kills Squeak 3.0) is one that is going to
> > be subject to crashes of a kind not common in other programming  
> >languages.
> 
> But it must also be acknowledged that it's trivial to fix 
> this problem if you know your compiler ;) If you file in the 
> attached CS nothing short of
> #instVarAt:put: will allow you to modify any of the globals 
> in Smalltalk. It doesn't capture any newly created globals 
> but that's left as an exercise to the reader :-)
> 
> Fun things to try after filing it in ...
> 
> 	Object := nil.
> 	Smalltalk at: #Collection put: nil.
> 	(Smalltalk associationAt: #CompiledMethod) value: nil.
> 
> ... or whatever else.
> 
> [NB, if there are enough people lobbying for this change I 
> might be convinced to clean it up and post it]
> 
> Cheers,
>   - Andreas
> 





More information about the Squeak-dev mailing list