[Vm-dev] Re: Is SmallInteger a really too dangerous class?

Bert Freudenberg bert at freudenbergs.de
Mon Dec 13 22:48:14 UTC 2010

On 13.12.2010, at 13:06, Mariano Martinez Peck wrote:

> sorry, it should be
> SmallInteger class >> initialize
>     self addInstVarName: 'Zaraza'.
> Notice I want to add a class variable to SmallIneteger, not instVar. 

This is not really a VM question. Class variables are held in a dictionary. The VM knows nothing about this.

You add class variables simply by adding them to the class pool:

	SmallInteger ensureClassPool.
	SmallInteger classPool at: #Zaraza put: 42.

- Bert -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101213/829e4c6c/attachment.htm

More information about the Vm-dev mailing list