New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explanation of the "Single Arg Rule" #600
Comments
|
I know I've been out of many recent conversations, but what is meant by "Single Arg Rule" here? Can you point to an example or discussion thread? |
|
The stuff where you put a comma after a single thing to make it do what you intend. That's what I heard it referred to as, but I don't know all the details of it, which is why I was trying to find the docs. <Zoffix> m: my @list = (1,),; dd @list
<camelia> rakudo-moar 2126ed: OUTPUT«Array @list = [(1,),]»
<Zoffix> m: my @list = (1),; dd @list
<camelia> rakudo-moar 2126ed: OUTPUT«Array @list = [1]»
<Zoffix> m: my @list = (1); dd @list
<camelia> rakudo-moar 2126ed: OUTPUT«Array @list = [1]»
<Zoffix> m: my @list = 1,; dd @list
<camelia> rakudo-moar 2126ed: OUTPUT«Array @list = [1]»
<Zoffix> m: my $list = 1,; dd $list
<camelia> rakudo-moar 2126ed: OUTPUT«Int $list = 1»
<Zoffix> m: my $list = (1,); dd $list
<camelia> rakudo-moar 2126ed: OUTPUT«List $list = $(1,)»
<Zoffix> m: my $list = (1,),; dd $list
<camelia> rakudo-moar 2126ed: OUTPUT«List $list = $(1,)» |
|
I tried to explain this (probably not very well) in https://perl6advent.wordpress.com/2015/12/14/day-15-2015-the-year-of-the-great-list-refactor/ Also there are details in S07 I think S On 17 June 2016 at 00:25, Zoffix Znet notifications@github.com wrote:
4096R/EA75174B Steve Mynott steve.mynott@gmail.com |
|
Yes, it's in S07: https://design.perl6.org/S07.html#The_single_argument_rule |
|
Where should this go then? List? |
|
Wait, but we have this? https://docs.perl6.org/type/Signature#index-entry-%2B_%28Single_Argument_Rule_Slurpy%29 |
|
Reopened to address @AlexDaniel concerns. |
|
Reopening this because #3268 |
It either needs to be documented, or if it is, indexed/made indexable by search engines.
The text was updated successfully, but these errors were encountered: