Pressures for Substantially New Squeaks

Reinier van Loon R.L.J.M.W.van.Loon at inter.nl.net
Mon Feb 15 23:19:01 UTC 1999


self wrote:

>
>Yes, location transparancy would be a nice thing. I'll have a stab at the
>ClassReference thing or maybe even at the ObjectReference thing. Let's see
>what can of worms I open...
>
Attached is a change set which allows you to code any variable name without
having it to define first. If the name is unknown the Parser shows you the
normal Unknown variable menu with one line added: Reference.
If you choose to declare it as a Reference it gets compiled as an
ObjectReference.

There is only one problem. The Interpreter doesn't play along.

If you execute the method funny things happen:

test
    SomeUndefinedName

prints 'nil->nil' (the ObjectReference)

and

test
    ^ SomeUndefinedName

prints 'nil' (the value of the ObjectReference)

Examining byte code tells us that the first method is compiled as returnSelf
and apparently SomeUndefinedName has become the receiver (incorrect I think,
but then again I'm hacking...). The second method is compiled as returnTop
and returns the top of the stack.

I implemented the value message of ObjectReference to look dynamically in
Smalltalk, but alas... I think it never gets asked. As far as I can tell the
method Interpreter>>literal:ofMethod: is the naughty one. It just fetches
the pointer of the literal. The literal is then pushed on the stack. Too
bad...

Reinier.





More information about the Squeak-dev mailing list