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

Tim Rowledge tim at sumeru.stanford.edu
Mon Apr 1 00:33:50 UTC 2002


Avi Bryant wrote:

> Read the subject of this thread - the original question, which everyone
> has been ignoring, is, why can't I do
> 
> 'foo' becomeForward: 3.
The pragmatic answer is that as you go through the code involved in
becomeForward you get to ObjectMemory>containsOnlyOops:and: which
carefully makes the prim fail if any items in the two arrays are
SmallIntegers - since you can't become SmallIntegers :-) I'd hazard a
guess that the implementor made use of existing code and simply never
considered that SmallIntegers could in fact be reasonable arguments for
becomeForward. Without spending a lot more time looking at the prim code
than I have to spare (I have varnish drying and needing some work) I
can't say for certain how much change would be needed, but I'm guessing
it might be complicated since it is not likely to be very clsoe to the
current code.

If you really need it, send me an RFQ and I'll get back to you :-)

tim





More information about the Squeak-dev mailing list