#++

Andres Valloud sqrmax at cvtci.com.ar
Sun Jun 13 04:15:50 UTC 1999


Hi.

> > I've just seen that it takes 4 bytecodes to increment a small integer
> > by 1, namely:
> [SNIP]
> > Wouldn't it be better to have another kind of bytecode, say
> The real problem with this is that SmallIntergers are manifest constants
> and cannot be side-effected this way. '++' and it's brethren are C-isms
> that rely on the way that C variables are merely labels for memory
> locations. A SmallInteger is absolutely _not_ just a memory location that
> can be pillaged by the local toughguys.

Ok... yes... one would not do this through selectors though. It's just
what the VM would do. What if the compiler, when compiling x _ x + y,
would produce the bytecode named "increment x by y, and if any error
send + as usual"? I agree that the notation "x ++ y." is not nice.
Most of my interest is aimed at bytecode execution, though... if less
bytecodes, then the VM has to perform less fetch+exec cycles.

> Although one could implement a ++ bytecode that would function, I cannot
> imagine any way it would be proper, moral, decent or otherwise acceptable.

I don't see your point here, regarding just the bytecode.

> As Adele says "Ask, don't touch" - and ++ is akin to groping someones
> underwear!

#++ the selector, I agree.

<++> the bytecode, why?

Andres.





More information about the Squeak-dev mailing list