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

rakudo doesn't like explicit $_ in multi-param signatures #2029

Closed
p6rt opened this issue Aug 6, 2010 · 6 comments
Closed

rakudo doesn't like explicit $_ in multi-param signatures #2029

p6rt opened this issue Aug 6, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Aug 6, 2010

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

Searchable as RT77054$

@p6rt
Copy link
Author

p6rt commented Aug 6, 2010

From @moritz

21​:53 < moritz_> rakudo​: for <a b>.kv -> $k, $_ { .perl.say }
21​:53 <+p6eval> rakudo 0e5edb​: OUTPUT«0␤1␤»
21​:53 < moritz_> huh.
21​:54 < moritz_> shouldn't that be "a", "b" ?
21​:54 < moritz_> rakudo​: for <a b>.kv -> $k, $v { $v.perl.say }
21​:54 <+p6eval> rakudo 0e5edb​: OUTPUT«"a"␤"b"␤»

I don't see why it shouldn't work with $_ if it works with $v.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2010

From @pmichaud

On Fri Aug 06 12​:56​:24 2010, moritz wrote​:

21​:53 < moritz_> rakudo​: for <a b>.kv -> $k, $_ { .perl.say }
21​:53 <+p6eval> rakudo 0e5edb​: OUTPUT«0␤1␤»
21​:53 < moritz_> huh.
21​:54 < moritz_> shouldn't that be "a", "b" ?
21​:54 < moritz_> rakudo​: for <a b>.kv -> $k, $v { $v.perl.say }
21​:54 <+p6eval> rakudo 0e5edb​: OUTPUT«"a"␤"b"␤»

I don't see why it shouldn't work with $_ if it works with $v.

It appears to be even weirder than the above illustrates -- if a
subroutine has $_ as any of its parameters, it seems to always take the
first argument​:

  pmichaud@​plum​:~/rakudo$ ./perl6
  > sub abc($x, $y, $_, $z) { say "$x $y $_ $z"; }; abc(1,2,3,4);
  2 3 1 4

Pm

@p6rt
Copy link
Author

p6rt commented Aug 7, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 7, 2010

From @pmichaud

Now fixed in 6ebba85 -- assigning to moritz for spectest verification.

Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Aug 8, 2010

From @moritz

Now tested in t/spec/S06-signature/positional.t

@p6rt
Copy link
Author

p6rt commented Aug 8, 2010

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

@p6rt p6rt closed this as completed Aug 8, 2010
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