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

Re: [perl #119455] [EXPERIMENT] pluggable keyword API

Thread Previous | Thread Next
Eric Brine
August 25, 2013 15:41
Re: [perl #119455] [EXPERIMENT] pluggable keyword API
Message ID:
On Sun, Aug 25, 2013 at 7:32 AM, Lukas Mai <> wrote:

> Devel::CallParser solves a different problem. I can only use it to
> implement custom argument syntax for subroutines, but what I actually
> want is custom keywords.
> For example: if I want to reimplement 'sub', I need to accept a bareword
> (subroutine name) followed by a block (subroutine body). None of the
> parse_args_* functions can be used for this.

You should have a look at Syntax::Feature::Loop. That's pretty much exactly
what it does, and it does it using Devel::CallParser.

(It actually provides C<< loop { ... } >>, but C<< mysub NAME { ... } >>
would be just as easy to implement.)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About