develooper Front page | perl.perl5.porters | Postings from July 2013

Re: postfix dereference syntax

Thread Previous
From:
Ricardo Signes
Date:
July 2, 2013 12:34
Subject:
Re: postfix dereference syntax
Message ID:
20130702123436.GA9895@cancer.codesimply.com
* Nicholas Clark <nick@ccl4.org> [2013-07-02T07:12:36]
> >   print "Things: $aref_of_things->@*"
> > 
> > ...which gets into less clearly-introduceable behavior.
> 
> This is "less clear" because right now that parses as
> 
> print 'Things: ' . $aref_of_things . '->@*'
> 
> not as a syntax error? ie we're changing the meaning of something valid.

Correct.

> Are there parsing ambiguities with a colon? Particularly, if a colon is
> expected because the opening '?' of a ternary has been seen, does this
> confuse things?

Colon was another suggestion that had been made, specifically $x->:@

I don't believe it's likely to be ambiguous, because the -> can't dangle in
front of a ternary's colon.

-- 
rjbs

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