develooper Front page | perl.perl5.porters | Postings from January 2010

Re: rvalue "statement" given blocks

Thread Previous
From:
Zefram
Date:
January 3, 2010 14:59
Subject:
Re: rvalue "statement" given blocks
Message ID:
20100103225909.GE24102@fysh.org
Ben Morrow wrote:
>The usual way to say 'this is a term' in Perl is unary +,

This is less nice than enclosing in parens.  It has the same problem as
parens that it is ordinarily used with something that could be parsed as
an expression: + is used to disambiguate braces as a hash constructor,
for which purpose other expressionish hints would work just as well.
Unlike parens, it fails to make clear where the expression ends, and it
results in the expression ending with the closing brace of a code block,
which as previously noted is confusing.

-zefram

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