On 24 February 2010 10:15, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
2010/2/24 Lukas Renggli <renggli@gmail.com>:
Huh? I am always assumed that binary selectors parsed in greedy manner, which means that if parser found the start of binary selector, it scans forward for following characters which can be part of selector, without exceptions, like '-' char..
I checked in the ANSI standard. Igor is right:
== ANSI: 3.5.6 Numbers ======
 binaryCharacter ::= '!' | '%' | '&'' | '*' | '+' | ','' | '/' | '<' | '=' | '>' | '?' | '@' | '\' | '~' | '|' | '-'  binarySelector ::= binaryCharacter+
Binary selectors are method selectors that appear similar to mathematical operators. A binary selector may be any length greater than or equal to one. If a negative <number literal> follows a binary selector there must intervening white space."
=========================
I somehow remembered the grammar differently and that the $- was only allowed in the first position. This doesn't seem to be the case though (any longer) :-/
I am not against changing the grammar to conform to ANSI and VW. I think that would actually be a good move, even if it is probably not really relevant in practice. I am however strongly against asking the user to disambiguate an expression. The compiler should compile what the user types, not guess what else he could have ment to say.
Lukas
Then the question is how you compile 1@-2 and how you provide backward compatibility.
As i said, i was always assumed that our parser works as ANSI says.. So, personally, i don't care about those who not followed it :) But yes, compatibility is now an issue :( Darn, why introducing a non-uniformity in syntax in a such way? When i hearing "hey, smalltalk expressions don't follow the 'usual' operators order of priority", i was always said - we don't need a non-uniform rules which complicating the syntax! But now , what a shame.. we actually having those! :)
Nicolas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.