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

Re: [perl #108286] continue, else and elsif (Wishlist: Overridable keywords)

Thread Previous | Thread Next
From:
Eric Brine
Date:
May 14, 2012 13:33
Subject:
Re: [perl #108286] continue, else and elsif (Wishlist: Overridable keywords)
Message ID:
CALJW-qGdociG8rYrQvwepscm8G_VuZDnzNJMb+FL+_aOnbLgpg@mail.gmail.com
On Mon, May 14, 2012 at 4:14 PM, Father Chrysostomos via RT <
perlbug-followup@perl.org> wrote:

> So, when should ‘if’ give up on trying to parse ‘else’?  Should ‘if(1){}
> else;’ pass ‘else’ to the keyword plugin?


I don't know what the way forward is for the keyword plugin.

The fact that it can't determine the difference between statement start,
expression(term) start and a context where a keyword is a reserved word
(e.g. "elsif" after a then block, "catch" after a try block) is
problematic. IIRC, you said Zephram recommends Devel::Declare over the
plugin handler for that reason.

Either there's something missing, or it's called too often.

- Eric

PS - If I understand correctly, the advantage of the plugin handler has
over Devel::Declare is that it's easy to lexically scope the effect. I
wonder if Lexical::Sub and Devel::Declare work together.


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