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

Re: Future::AsyncAwait and sub signatures

Thread Previous | Thread Next
January 18, 2018 02:56
Re: Future::AsyncAwait and sub signatures
Message ID:
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).


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