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

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

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 25, 2013 15:41
Subject:
Re: [perl #119455] [EXPERIMENT] pluggable keyword API
Message ID:
CALJW-qGMAULe7XtrPbkBgSxrwtJv2FNFYF0d-mkSnmfOD=W6tQ@mail.gmail.com
On Sun, Aug 25, 2013 at 7:32 AM, Lukas Mai <plokinom@gmail.com> 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


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