Skip to content
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

Marking an array as slurpy makes it unaccessible by name #1688

Closed
p6rt opened this issue Apr 13, 2010 · 5 comments
Closed

Marking an array as slurpy makes it unaccessible by name #1688

p6rt opened this issue Apr 13, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Apr 13, 2010

Migrated from rt.perl.org#74344 (status was 'resolved')

Searchable as RT74344$

@p6rt
Copy link
Author

p6rt commented Apr 13, 2010

From @moritz

17​:23 <@​moritz_> rakudo​: proto sub a(*@​val) { say @​val.perl }; a(​:val<a
b c>)
17​:23 < p6eval> rakudo cb4521​: OUTPUT«Unexpected named parameter 'val'
  passed␤current instr.​: 'a' pc 223 (EVAL_1​:83)␤»
17​:23 <@​moritz_> rakudo​: proto sub a(@​val) { say @​val.perl }; a(​:val<a b c>)
17​:23 < p6eval> rakudo cb4521​: OUTPUT«("a", "b", "c")␤»

The only difference between these two lines the * in front of the @​val
parameter. Obviously it should work with it, too

@p6rt
Copy link
Author

p6rt commented May 30, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-signature/slurpy-params.t

commit 57d87c05c9a9f78b3519ce5e246ea2b5a7420ffa
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun May 30 20​:31​:40 2010 +0000

  [t/spec] test for RT #​74344, call slurpy params by name
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31003 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S06-signature/slurpy-params.t b/t/spec/S06-signature/slurpy-params.t
index cbc77b9..4b8e748 100644
--- a/t/spec/S06-signature/slurpy-params.t
+++ b/t/spec/S06-signature/slurpy-params.t
@@ -295,6 +295,13 @@ eval_dies_ok 'sub rt65324(*@x, $oops) { say $oops }',
 }
 
 
+# RT #74344
+#?rakudo skip 'RT 74344'
+{
+    sub slurpy-by-name(*@var) { @var.join('|') }
+    is slurpy-by-name(:var<a v g>), 'a|v|g', 'Can call slurpy param by name';
+}
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented May 30, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 23, 2011

From @moritz

Calling positionals by name is now deprecated, so closing.

@p6rt
Copy link
Author

p6rt commented May 23, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant