binary selectors ambiguity and space
ncellier at ifrance.com
Mon May 15 23:39:51 UTC 2006
Le Mardi 16 Mai 2006 00:11, Andreas Raab a écrit :
> Stephan Rudlof wrote:
> > NCITS J20 DRAFT December, 1997 33 of ANSI Smalltalk Standard revision
> > 1.9; in short:
> > - 'White space is allowed between the '-' and the <number>' for a
> > numeric literal; and
> > - 'If a negative <number literal> follows a binary selector there must
> > intervening white space.'
> Just out of curiosity, which of the Smalltalks that claim to be ANSI
> compliant actually implement the above? A dead giveaway would probably
> be Number>>#@- (except that according to ANSI this requires spaces, too,
> right? right??? ;-) so can anyone confirm which Smalltalks out there
> actually compile according to those rules? Briefly checking VW shows it
> doesn't, neither does Squeak. What about others?
> - Andreas
In ST/X 5.2.6
1 at -2 is interpreted (1) @ (-2)
1 at - 2 is interpreted (1) @- (2)
And (- 1) give a warning
error: non standard Squeak extension: space betwen sign and number.
But we can proceed and get (-1)
Well, not exactly ANSI, but very close to my interpretation...
More information about the Squeak-dev