Skip Menu |
Report information
Id: 131922
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: comdog <brian.d.foy [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
Date: Fri, 18 Aug 2017 10:09:44 -0400
Subject: [LTA] "Variadic" or "slurpy"?
From: brian d foy <brian.d.foy [...] gmail.com>
Download (untitled) / with headers
text/plain 780b
Consider this program which I don't expect to work (and it doesn't compile): sub show-the-arguments ( *@args, $i ) { put "The arguments are @args[]"; } show-the-arguments( 1, 3, 7 ); The error message says "variadic": Cannot put required parameter $i after variadic parameters But another sort of error uses a different term: sub show-the-arguments ( *@args, $i ) { put "The arguments are @args[]"; } This time the error messages say "slurpy": Only one slurpy positional allowed The docs almost almost always say "slurpy" and the uses of "variadic" only appear as synonyms next to "slurpy": * https://github.com/perl6/doc/search?utf8=✓&q=variadic&type= * https://github.com/perl6/doc/search?utf8=✓&q=slurpy&type=
This could've been a LHF, except for these tests: https://github.com/perl6/roast/blob/4bfd6d2374cb4ea1b8fa057a5f294b988e4dec44/S32-exceptions/misc.t#L180-L185

 ¯\_(ツ)_/¯

But yes, I think it should say “slurpy” everywhere.

On 2017-08-18 07:10:52, comdog wrote:
Show quoted text
> Consider this program which I don't expect to work (and it doesn't compile):
>
> sub show-the-arguments ( *@args, $i ) {
> put "The arguments are @args[]";
> }
>
> show-the-arguments( 1, 3, 7 );
>
> The error message says "variadic":
>
> Cannot put required parameter $i after variadic parameters
>
> But another sort of error uses a different term:
>
> sub show-the-arguments ( *@args, $i ) {
> put "The arguments are @args[]";
> }
>
> This time the error messages say "slurpy":
>
> Only one slurpy positional allowed
>
> The docs almost almost always say "slurpy" and the uses of "variadic"
> only appear as synonyms next to "slurpy":
>
> * https://github.com/perl6/doc/search?utf8=✓&q=variadic&type=
>
> * https://github.com/perl6/doc/search?utf8=✓&q=slurpy&type=


RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
Only *@foo and *%foo are slurpy, as in "slurping up the rest of the arguments. But the term "variadic" refers to all optional arguments including named ones, so it would be incorrect to call those "slurpy", because they don't. It's like the difference between * and ? in regex. Larry On Fri, 18 Aug 2017 07:10:52 -0700, comdog wrote: Show quoted text
> Consider this program which I don't expect to work (and it doesn't compile): > > sub show-the-arguments ( *@args, $i ) { > put "The arguments are @args[]"; > } > > show-the-arguments( 1, 3, 7 ); > > The error message says "variadic": > > Cannot put required parameter $i after variadic parameters > > But another sort of error uses a different term: > > sub show-the-arguments ( *@args, $i ) { > put "The arguments are @args[]"; > } > > This time the error messages say "slurpy": > > Only one slurpy positional allowed > > The docs almost almost always say "slurpy" and the uses of "variadic" > only appear as synonyms next to "slurpy": > > * https://github.com/perl6/doc/search?utf8=✓&q=variadic&type= > > * https://github.com/perl6/doc/search?utf8=✓&q=slurpy&type=
Date: Fri, 18 Aug 2017 18:37:35 +0000
To: perl6-bugs-followup [...] perl.org
Subject: Re: [perl #131922] [LTA] "Variadic" or "slurpy"?
From: brian d foy <brian.d.foy [...] gmail.com>
Download (untitled) / with headers
text/plain 254b
Several areas of the docs then need to correct that. No matter what you decide, a user should be able to take the tricky words in an error message and usefully find them in the docs. 


--


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org