Hi Daniel,

I know that  "println [1, 2, 3]" fails, but I literally have never wanted to literally print a list literal ;-)

My question was related to the fact that there is only whitespace + newline right after the opening list bracket "[", and that this syntax variety would  conceivably not be used if someone was going for an index expression. Backward compatibility breaking changes aside, would the Parrot be able to discern these cases ?


On 06.04.2018 18:25, Daniel.Sun wrote:
Hi mg,

       `foo [....]` is ambiguous, parser can parse it as index expression or
parse it as method invocation without parentheses, the former is applied to
solve the ambiguity.

        Similarly, `println [1, 2, 3]` will fail too ;-)


Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html

Reply via email to