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

Re: "no snails"; or having signatured subs complain about @_

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
December 9, 2021 20:49
Subject:
Re: "no snails"; or having signatured subs complain about @_
Message ID:
20211209204900.1d533b69@shy.leonerd.org.uk
On Thu, 09 Dec 2021 21:45:13 +0100
Tomasz Konojacki <me@xenu.pl> wrote:

> On Thu, 9 Dec 2021 20:32:10 +0000
> Dave Mitchell <davem@iabyn.com> wrote:
> 
> > So by your logic, we're not allowed to change the behaviour of @_ in
> > signature subs (the main thrust of this thread)?  
> 
> As I said in the "getting signatures out of experimental" thread, I'm
> OK with @_ removal because I don't consider it a dramatic change.
> Overwhelming majority of signatured subs don't use @_ and those that
> do can be modified to stop using it.

Having read the prior arguments, I'm kinda with Dave on this one.
@DB::args is already shockingly broken in a lot of ways. Making it
always appear empty when called within a signatured sub is, honestly,
not the worst of its already-current breakages.

> If there was an alternative to @DB::args, my stance on its removal
> would've been different.

Perhaps we need to create a better replacement, then. A new function
(*function*, not weird side-effect of a variable being populated when a
core op is called from a specifically-named caller package) whose
presence indicates "hey perl, don't throw away args from the stack, but
remember them". This can then act as a far more reliable interface onto
the arguments, however they are implemented.

-- 
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