[PROPOSAL] Disallow // and \\ in Slang code (was: Re: Squeak archeology - quo vs. //)

Bert Freudenberg bert at impara.de
Wed Apr 7 09:40:55 UTC 2004


Am 06.04.2004 um 22:29 schrieb Ian Piumarta:
>
> C99 requires the division and modulus operators to truncate towards 
> zero (consistent with Fortran).  Since C99 is already here, you 
> _should_ count on it.

How about we disallow // and \\ in the Slang translator to make sure 
that anyone using it is aware of the differing semantics? We would 
introduce #div: and #mod: generating explicit code rounding towards 
negative infinity and use #quo: and #rem: to get the C99 meaning. The 
error message when translating code with // or \\ should explain the 
difference, and point out that in most cases one will want to use #quo: 
or #rem:.

What this buys us is that we can rely on the simulator doing the same 
as the Smalltalk code. Which is important, IMHO.

- Bert -




More information about the Squeak-dev mailing list