develooper Front page | perl.perl5.porters | Postings from March 2021

Re: De-experimentalising "signatures"

Thread Previous | Thread Next
Alexander Hartmaier
March 27, 2021 16:01
Re: De-experimentalising "signatures"
Message ID:
On Sat, Mar 27, 2021 at 1:39 PM Paul "LeoNerd" Evans <>

> On Fri, 26 Mar 2021 22:28:30 -0700
> Darren Duncan <> wrote:
> > I would propose and expect that @_ should continue to behave the same
> > as it always did, and be available in every subroutine, and that
> > signatures just provides an overlay plus constraint check.
> ...
> > The key thing is that I consider access to a single value
> > representing the entire collection of actual arguments to be an
> > important fundamental feature that should never go away.
> I don't think anyone is suggesting to get rid of @_ because they don't
> "like" it, or it's messy or confuses newbies or anything.
> The primary motivation to get rid of @_ is that it is slow. It is a
> large performance drain on the overhead of the ENTERSUB op, which is
> involved in every single function call that Perl ever makes. If we were
> able to skip that part for the majority of subs which don't need it
> (because they'd be written with signatures), then the entire program
> runs faster.
> Performance is a feature.

Oh, I didn't know that!
When I'm using signatures, I replace the @_ usage with them, for example in
Regarding performance I'd suggest having no @_ in a sub that has a
As we'll have to keep the signatureless subs with @_ for backcompat for
like forever, I don't see what else there is to discuss?

> --
> Paul "LeoNerd" Evans
>      |
>  |

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