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

42, 44, 22 -> *@a { say @a.perl } #2577

Closed
p6rt opened this issue Dec 11, 2011 · 7 comments
Closed

42, 44, 22 -> *@a { say @a.perl } #2577

p6rt opened this issue Dec 11, 2011 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 11, 2011

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

Searchable as RT105872$

@p6rt
Copy link
Author

p6rt commented Dec 11, 2011

From @zhuomingliang

JimmyZ> nom​: if 42 -> *@​_ { say @​_.perl }
p6eval> nom 1f9310​: OUTPUT«Array.new()␤»

JimmyZ> niecza​: if 42, 44, 22 -> *@​a { say @​a.perl }
p6eval> niecza v12-10-ga8ad0e9​: OUTPUT«(42, 44, 22)␤»

JimmyZ>nom​: if 42, 44, 22 -> *@​a { say @​a.perl }
p6eval>nom 1f9310​: OUTPUT«Array.new()␤»

jnthn> JimmyZ​: oh, oddness...
jnthn> JimmyZ​: Anyway, I can probably fix it. Feel free to submit a ticket.

JimmyZ> nom​: while 42, 44, 22 -> *@​a { say @​a.perl; last }
p6eval> nom 70d715​: OUTPUT«Array.new()␤»
JimmyZ> niecza​: while 42, 44, 22 -> *@​a { say @​a.perl; last }
p6eval> niecza v12-11-g20a790d​: OUTPUT«(42, 44, 22)␤»

@p6rt
Copy link
Author

p6rt commented Aug 27, 2014

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 1, 2015

From @usev6

This has not changed​:

$ perl6 -e 'if 42, 44, 22 -> *@​a { say @​a.perl }'
Array.new()

$ perl6 -e 'while 42, 44, 22 -> *@​a { say @​a.perl; last }'
Array.new()

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 1, 2015

From @usev6

This has not changed​:

$ perl6 -e 'if 42, 44, 22 -> *@​a { say @​a.perl }'
Array.new()

$ perl6 -e 'while 42, 44, 22 -> *@​a { say @​a.perl; last }'
Array.new()

@p6rt
Copy link
Author

p6rt commented Jan 12, 2016

From @awwaiid

Putting parens around the signature makes it work​:

$ perl6 -e 'while 42, 44, 22 -> (*@​a) { say @​a.perl; last }'
[42, 44, 22]

$ perl6 -e 'if 42, 44, 22 -> (*@​a) { say @​a.perl }'
[42, 44, 22]

I don't know if the parenthesis SHOULD be required or not.

@p6rt
Copy link
Author

p6rt commented Feb 10, 2018

From @zoffixznet

On Sat, 10 Dec 2011 18​:37​:03 -0800, jimmy.zhuo@​gmail.com wrote​:

JimmyZ> nom​: if 42 -> *@​_ { say @​_.perl }
p6eval> nom 1f9310​: OUTPUT«Array.new()␤»

JimmyZ> niecza​: if 42, 44, 22 -> *@​a { say @​a.perl }
p6eval> niecza v12-10-ga8ad0e9​: OUTPUT«(42, 44, 22)␤»

JimmyZ>nom​: if 42, 44, 22 -> *@​a { say @​a.perl }
p6eval>nom 1f9310​: OUTPUT«Array.new()␤»

jnthn> JimmyZ​: oh, oddness...
jnthn> JimmyZ​: Anyway, I can probably fix it. Feel free to submit a ticket.

JimmyZ> nom​: while 42, 44, 22 -> *@​a { say @​a.perl; last }
p6eval> nom 70d715​: OUTPUT«Array.new()␤»
JimmyZ> niecza​: while 42, 44, 22 -> *@​a { say @​a.perl; last }
p6eval> niecza v12-11-g20a790d​: OUTPUT«(42, 44, 22)␤»

Thank you for the report. This is now fixed.

Fix​: Raku/nqp@8e7201eb64
  rakudo/rakudo@dfb6d951d7
  rakudo/rakudo@ef1d22f4c1
Test​: Raku/roast@aa90737df1

On Mon, 11 Jan 2016 18​:43​:32 -0800, awwaiid wrote​:

Putting parens around the signature makes it work​:

$ perl6 -e 'while 42, 44, 22 -> (*@​a) { say @​a.perl; last }'
[42, 44, 22]

$ perl6 -e 'if 42, 44, 22 -> (*@​a) { say @​a.perl }'
[42, 44, 22]

I don't know if the parenthesis SHOULD be required or not.

No, with parentheses you're taking a single positional arg and then unpacking its Capture.

@p6rt
Copy link
Author

p6rt commented Feb 10, 2018

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

@p6rt p6rt closed this as completed Feb 10, 2018
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant