[OT] Writing a parser for BASIC in Smalltalk/Squeak ? (<CSOTD> included)

Andres Valloud sqrmax at prodigy.net
Wed Jan 9 19:26:49 UTC 2002


Hi.

> > > > | m n |
> > > > n _ 2.
> > > > m _ 3.
> > > > n _ m + (m _ n)
> Looking at the bytecodes of the method clearly show why it happens
> and I think it must count as a pretty nasty bug.

On the other hand, what is the expression saying?

1. Take m.
2. Make m be a name for n.
3. Take m (meaning n).
4. Sum together.

The key here is that we seem to expect names in an expression to remain
constant while it's evaluated.  In this case however, a name changes in
mid-expression.  I think the result is perfect and predictable behavior.

Andres.




More information about the Squeak-dev mailing list