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

Can't pass in several same-named named parameters to a sub #2157

Closed
p6rt opened this issue Sep 11, 2010 · 8 comments
Closed

Can't pass in several same-named named parameters to a sub #2157

p6rt opened this issue Sep 11, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Sep 11, 2010

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

Searchable as RT77788$

@p6rt
Copy link
Author

p6rt commented Sep 11, 2010

From @masak

<masak> rakudo​: sub foo(*%p) { say %p.perl }; foo(a => 'b', a => 'c')
<p6eval> rakudo a93dcb​: OUTPUT«duplicate named argument in call [...]
* masak submits rakudobug
<masak> rakudo​: sub foo(*%p) { say %p.perl }; my %h = a => 'b';
foo(|%h, a => 'c')
<p6eval> rakudo a93dcb​: OUTPUT«duplicate named argument in call [...]

S06 explicitly allows passing the same named parameter several times.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Sat Sep 11 11​:18​:59 2010, masak wrote​:

<masak> rakudo​: sub foo(*%p) { say %p.perl }; foo(a => 'b', a => 'c')
<p6eval> rakudo a93dcb​: OUTPUT�duplicate named argument in call [...]
* masak submits rakudobug
<masak> rakudo​: sub foo(*%p) { say %p.perl }; my %h = a => 'b';
foo(|%h, a => 'c')
<p6eval> rakudo a93dcb​: OUTPUT�duplicate named argument in call [...]

S06 explicitly allows passing the same named parameter several times.

Partially fixed​:

16​:29 < [Coke]> rakudo​: sub foo(*%p) { say %p.perl }; foo(a => 'b', a =>
'c')
16​:29 <+p6eval> rakudo 88c5a5​: OUTPUT«("a" => "c").hash␤»

16​:30 < [Coke]> rakudo​: sub foo(*%p) { say %p.perl }; my %h = a => 'b';
  foo(|%h, a => 'c')
16​:30 <+p6eval> rakudo 88c5a5​: OUTPUT«duplicate named argument in call␤
in
  block <anon> at /tmp/N93o4ziKBC​:1␤ in <anon> at
  /tmp/N93o4ziKBC​:1␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

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

@p6rt
Copy link
Author

p6rt commented Jan 4, 2013

From @bbkr

foo(|%h, a => 'c') still broken in 2012.12

@p6rt
Copy link
Author

p6rt commented Jun 29, 2015

From @usev6

This works now on rakudo.jvm. On rakudo.moar 'foo(|%h, a => "c")' doesn't give the correct result, yet​:

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h, a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h, a => "c")'
{​:a("b")}<>

I added two tests (the second fudged 'todo' for rakudo.moar) to S06-signature/named-parameters.t with commit Raku/roast@42df59c101

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 29, 2015

From @usev6

This works now on rakudo.jvm. On rakudo.moar 'foo(|%h, a => "c")' doesn't give the correct result, yet​:

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h, a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h, a => "c")'
{​:a("b")}<>

I added two tests (the second fudged 'todo' for rakudo.moar) to S06-signature/named-parameters.t with commit Raku/roast@42df59c101

@p6rt
Copy link
Author

p6rt commented Nov 16, 2015

From @jnthn

On Mon Jun 29 13​:58​:37 2015, bartolin@​gmx.de wrote​:

This works now on rakudo.jvm. On rakudo.moar 'foo(|%h, a => "c")'
doesn't give the correct result, yet​:

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-j -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h,
a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; foo(a => "b", a => "c")'
{​:a("c")}<>

$ perl6-m -e 'sub foo(*%p) { say %p.perl }; my %h = a => "b"; foo(|%h,
a => "c")'
{​:a("b")}<>

I added two tests (the second fudged 'todo' for rakudo.moar) to S06-
signature/named-parameters.t with commit
Raku/roast@42df59c101

Fixed and unfudged.

/jnthn

@p6rt p6rt closed this as completed Nov 16, 2015
@p6rt
Copy link
Author

p6rt commented Nov 16, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant