develooper Front page | perl.perl6.compiler | Postings from May 2018

[perl #127143] Different Behaviour With/Without Commas in Sub/MethodCalls and slipped hashes

Thread Previous
From:
Brian S. Julin via RT
Date:
May 21, 2018 16:13
Subject:
[perl #127143] Different Behaviour With/Without Commas in Sub/MethodCalls and slipped hashes
Message ID:
rt-4.0.24-7064-1526919196-484.127143-80-0@perl.org


Without the comma, the colonpair is in infix position, which means
it applies to the prefix unary | operator.

So whether this should be an error or "work" depends on what we can teach the |
operator to do with fake_infix adverbs it is passed.

Note if we fix | to use fake infix adverbs, then we create the problem
that |(1,1),(2,2),:f :g will be 1,1,:g,(2,2),:f.

It might be best to teach | to throw when it is handed such things.

There are several other operators that will find themselves in the same
situation... especially we have other tickets about = which gets tricky
due to the difference between list and scalar assignment.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About