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

Re: "Keyword" labels now forbidden (was [perl.git] branch blead,updated. GitLive-blead-1705-gf71d615)

Thread Previous | Thread Next
From:
Chip Salzenberg
Date:
July 30, 2009 10:36
Subject:
Re: "Keyword" labels now forbidden (was [perl.git] branch blead,updated. GitLive-blead-1705-gf71d615)
Message ID:
20090730172735.GD6796@tytlal.topaz.cx
On Thu, Jul 30, 2009 at 08:18:25AM +0200, Rafael Garcia-Suarez wrote:
> I guess that only demonstrates that one can never underestimate the
> importance of backwards compatibility. I would never have guessed I
> had such a report that fast.

Let's recall that the original bug report from Andy was about "BEGIN{}"
vs. "BEGIN:{}".

Disallowing all keywords as tags seems a bit draconian, especially since we
could more CHECK-like keywords in the future.  In fact one reason we were
able to add CHECK is because we don't historically have any restriction
about using that kind of keyword as a label or filehandle.  Granted, in
future such keywords may be recognized only with C<use 5.011>, so this point
is weaker than it would otherwise be.  Even so, breaking BackPAN in this
case seems unnecessary.

I have two suggestions, either/both of which I think would be nice.

First, how about if we disallow only the BEGIN-family of keywords as labels?
Considering the original bug report those are the ones that can cause
trouble.  Writing "for: {}" is weird but why should we stop you, really?

Second, how about if any limitations on labels is only if they're to blocks?
There's no possible confusion about the meaning of the label in:

  sub foo () {
    CHECK: for (@a) { ... }
  }

so I don't think we need to forbid it.
-- 
Chip Salzenberg

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