Why can't I do (aNonSmallInteger becomeFoward: aSmallInteger)?

Avi Bryant avi at beta4.com
Sun Mar 31 19:58:58 UTC 2002


On Sun, 31 Mar 2002, Andreas Raab wrote:

> > Yes, but he's talking about #becomeForward:, not #become:
> >
> > So, there is a good question why it doesn't/can't work.
>
> Same issue in both cases. SmallIntegers are not referenced - they are
> always used 'by value'. Thus, whenever you 'use' or 'reference' a
> SmallInteger you are actually creating a copy of that SmallInteger (just
> in the most efficient way possible). Which effectively means that
> #becomeForward: could (at best) be a no-op, since what you're really
> getting is something like
> 	1 copy becomeForward: 2 copy.

Read the subject of this thread - the original question, which everyone
has been ignoring, is, why can't I do

'foo' becomeForward: 3.

The original poster clearly understood why you can't becomeForward: a
small integer into something else, but nobody's given a good reason yet
why you can't becomeForward: something else into a small integer.





More information about the Squeak-dev mailing list