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

Re: Discourage @_ in signatured subroutine

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
January 25, 2022 16:32
Subject:
Re: Discourage @_ in signatured subroutine
Message ID:
20220125163238.1127cdf0@shy.leonerd.org.uk
On Sun, 16 Jan 2022 15:41:44 +0000
"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> wrote:

> I've started a branch to add a discouragement warning when people try
> to rely on the @_ array inside a signatured sub:
> 
>   https://github.com/Perl/perl5/pull/19346

This is now ready for review/merge, but I'm suddenly unsure about one
detail: What should the warning category be?

I've currently put it in a new category called "discouraged", on the
thought that it is a bit similar to "deprecated" but not quite the same.

I'm suddenly unsure though, whether it would be better for this to have
its own category - perhaps called "snail" or something? I'm thinking of
a situation where, if we added other "discouraged" warnings of
unrelated things, whether someone might have done

  no warnings 'discouraged';

to turn off these ones, then they wouldn't see those others. It perhaps
might be best for this particular category of problem (use of @_ in
signatured sub) to have its own warning category, to minimise the risk
of that collateral damage.

Thoughts?

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