On Mon, 19 Apr 2004, Larry Wall wrote: > On Sat, Apr 17, 2004 at 01:07:44PM -0500, Abhijit A. Mahabal wrote: > : $obj.method ($x + $y) + $z > : > : >From the earlier examples (like $obj.method +1), I got the impression that > : you look ahead until you find a term or an operator. In the example above, > : isn't ($x + $y) a full term, all by itself, and in that case would not
> : What am I missing? > > The distinction is not term/operator exactly. It's a four-way distinction > between > > definitely a postfix op -> () hold arguments, otherwise no arguments > definitely a binary op -> there are no arguments > ambiguous -> require disambiguation > definitely a term -> treat method as list operator > > where the last category assumes that the term indicates the first item > in an expression. (Note that a definite unary operator is the beginning > of a term.) > $obj.meth, -> obviously not arguments > $obj.meth $foo,$bar -> obviously arguments > $obj.meth() + $bat -> obviosly not arguments $obj.meth () + $bat -> obviosly not arguments $obj.meth ($foo + $bar) + $bat -> ambiguous, likely to be list $obj.meth($foo + $bar) + $bat -> $foo + $bar the argument $obj.meth($foo + $bar), $bat -> list Is that about the story so far? Or is the last example probably going to be illegal without a space? How bad is it to require space before arguments that are a list, so that the no-space case is unambiguous? > Larry --Abhijit