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

Re: arity checking (was Re: PSC #049 2022-01-07)

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
January 21, 2022 18:30
Subject:
Re: arity checking (was Re: PSC #049 2022-01-07)
Message ID:
20220121183021.51e2e4d6@shy.leonerd.org.uk
On Sat, 22 Jan 2022 02:20:21 +0800
Tom Molesworth via perl5-porters <perl5-porters@perl.org> wrote:

> Your eval workaround assumes that the directly-called sub is the only
> possible thing which can throw the exception - what if that's
> triggered by a sub further down?
> 
> I ended up writing
> https://metacpan.org/dist/Acme-Signature-Arity/view/lib/Acme/Signature/Arity.pod
> as a proof-of-concept API, but would hope that core Perl will expose
> some sort of arity inspection in due course. Ignoring this
> library-extensibility use-case while simultaneously promoting
> signatures as a complete replacement for @_-based subs seems less
> than ideal to me.

Ah; I just addressed both of those points in my reply just now ;)

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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