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

@_ is experimental in signatured subs [was: Re: Discourage @_ insignatured subroutine]

Thread Previous | Thread Next
Paul "LeoNerd" Evans
January 28, 2022 18:08
@_ is experimental in signatured subs [was: Re: Discourage @_ insignatured subroutine]
Message ID:
On Tue, 25 Jan 2022 16:32:38 +0000
"Paul \"LeoNerd\" Evans" <> wrote:

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

After further discussion at today's PSC meeting, we decided this
warning should be under the `experimental::` space, because the
behaviour of @_ inside a signatured sub is really the one thing that
remains experimental about signatures (besides all the new features we
intend to add, but they can be added independently).

I've therefore changed the warning category to the cute-but-nonobvious

  no warnings 'experimental::snail_in_signatures';

I'm not sure this name is very clear for users to read or discover, but
I couldn't think of anything else sufficiently snappy and short. If
anyone has any better suggestions I'll consider them.

In the meantime, since the old PR was getting full of old junk and in
any case github doesn't let you rename the branch of a currently-open
PR, I closed it and opened a brand new one:

Paul "LeoNerd" Evans      |  |

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