binary selectors ambiguity and space

Alexandre Bergel Alexandre.Bergel at cs.tcd.ie
Sun May 14 08:30:51 UTC 2006


> What do squeakers think of this change ?

go for it, but write tests :-)

Cheers,
Alexandre


>
> Nicolas
>
>
> Le Samedi 13 Mai 2006 02:36, Dan Ingalls a écrit :
>> Well, the *idea* was that you should not need spaces, and St-76,  
>> borrowing
>> from APL, had a different character for the semantically different
>> high-minus sign for negative literals, so this was not a problem.
>> High-minus bit the dust with the ascii changes of St80 thus  
>> necessitating a
>> space before negative literals that follow binary messages.
>>
>>> Sorry cannot find the thread which started this discussion,
>>> but it seems i cannot have some binary selector with minus sign  
>>> last.
>>>
>>> For example, i can compile
>>>    Compiler evaluate: 'nil -+ nil'
>>> Or
>>>    Compiler evaluate: 'nil -/+ nil'
>>>
>>> But i cannot compile
>>>    Compiler evaluate: 'nil +- nil'
>>> nor
>>>    Compiler evaluate: 'nil +/- nil'
>>>
>>> I understand that eventually some expressions might be ambiguous  
>>> like
>>> 1+-2 that can be interpreted as (1) + (-2) or (1) +- (2)
>>> But such ambiguity could raise an error or warning,
>>> and in most case, spaces will help disambiguating:
>>> 1+-   2 would be (1) +- (2)
>>> 1+   -2 would be (1) + (-2)
>>
>> Agreed.
>>
>>> Funny, in current 3.9 spaces are ignored:
>>> i have '1 +-   2' interpreted as (1) + (-2)
>>>
>>> I cannot even write 1 +-+ 2, though no ambiguity lie there...
>>
>> Agreed.
>>
>>> I guess all this is very squeak specific
>>
>> I don't know, but it ought to be fixed.
>>
>> 	- Dan
>
>

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.cs.tcd.ie/Alexandre.Bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






More information about the Squeak-dev mailing list