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

Re: [perl #113554] my() with empty list causes weird error

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
July 5, 2012 20:35
Subject:
Re: [perl #113554] my() with empty list causes weird error
Message ID:
20120706033527.GG20266@cancer.codesimply.com
* Ricardo Signes <perl.p5p@rjbs.manxome.org> [2012-06-25T20:38:46]
> It seems open to change.  The question is: what's the cost, and what's the
> benefit?

I think the feature seems low in both cost and benefit, with the key difference
that once we allow "my();" we will be hard pressed to disallow it later, if we
realize we should, as we'll be breaking something.  I'm not entirely opposed to
breaking code at the edges of sanity, but it sounds like there's very little
practical argument to make this edge case permitted.  Allowing "my()" won't
really make it act like "normal" built-ins.  It will make it a little more like
one, but not enough to be worth even the relatively small risk of future
headaches.

As for the "this was made legal in 1999, but failed because of a separate
issue," that may be the case, but I don't believe it was really done
deliberately.  I've reviewed the (quite enjoyable*) p5p archives from that
summer of 1999, and I don't think this particular change was even noticed.
Further, it was made as part of adding subroutine attributes, which are hardly
something we look back on as one of our best designs.

* I particularly enjoyed Tom's notes on Python at
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-08/msg00743.html
  and then all the replies.

-- 
rjbs

Thread Previous | Thread Next


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