develooper Front page | perl.perl5.porters | Postings from January 2018

Re: Future::AsyncAwait and sub signatures

Thread Previous | Thread Next
From:
Zefram
Date:
January 18, 2018 02:56
Subject:
Re: Future::AsyncAwait and sub signatures
Message ID:
20180118025558.GJ22873@fysh.org
Paul "LeoNerd" Evans wrote:
>  optree = (*PL_sub_body_hook)(aTHX_ optree);

That sort of hook seems dubious.  Blanket application to all subs makes
it tricky to implement any targeted effect, and giving the hook only
the optree makes it fairly limited in power.

>able to suggest a different method I can let my users have `async sub`s
>with signatures?

Do it the other way round: your code should control the top-level parsing
and treatment of ops, and call into the core parser to parse the specific
parts of the standard syntax.  You want a signature parsing API function
[perl #132474], and a similar API function to parse attributes (for
which you should open a ticket).

-zefram

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