In VisualWorks:3 @ Argument expected ->- 5I guess what one expects is a matter of habit, personally I'd expect x - - y to yield a parsing error.Cheers,HenryOn 10 Nov 2014, at 12:06 , PBKResearch <peter@pbkresearch.co.uk> wrote:I have tried this on my latest Dolphin (Pro 6.1 Beta 2):3 @ -5 is accepted and interpreted correctly.3 @ - 5 is rejected with message: ‘Error – incorrect expression start’; the caret is pointing at the – sign.So the Opal behaviour does not mirror that of Dolphin.Hope this helpsPeter KennyFrom: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Thierry Goubier
2014-11-10 8:47 GMT+01:00 Henrik Johansen <henrik.s.johansen@veloxit.no>:3 @ -5 is not a problem, and accepted by both.3 @ - <space> 5 is what I object to (and Opal allows)RBParser allows this one even if old Compiler dissallows it (i.e. in Pharo 2).
I haven't tracked if Opal follows the RBParser on that or if this is the reverse (Opal pushed changes on RBParser). I suspect all things RB in Pharo (and Squeak?) are a port from the Dolphin version of RB, which means this is allowed in quite a few other smalltalks (Dolphin?, VW?).
I haven't checked if the SmaCC Smalltalk parser accept that.
Note: 4 - 5 in RBParser does what you would expect. 4 - - 5 as well.3 @-5 and/or 3 @- 5 is (rightly) disallowed by both.That one is easier and expected.
My position would be twofold:
- RBParser is, IMHO, a good parser and I would follow its interpretation. That Opal reuses it is a good point for me.- As a programming language designer (and parser implementor), accepting - 5 is user friendly, but a bit too contextual in the lexer to be nice to implement.ThierryCheers,Henry