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

Assignment and C<|> flattening confuses Rakudo #1422

Closed
p6rt opened this issue Dec 4, 2009 · 6 comments
Closed

Assignment and C<|> flattening confuses Rakudo #1422

p6rt opened this issue Dec 4, 2009 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 4, 2009

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

Searchable as RT71034$

@p6rt
Copy link
Author

p6rt commented Dec 4, 2009

From @masak

<masak> rakudo​: my $a = 1, 2, 3; my @​a = |$a; say @​a.perl
<p6eval> rakudo 7ef386​: too many positional arguments​: 4 passed, 2
expected [...]
<masak> uh.
<masak> did I just confuse the assignment builtin?
<JimmyZ> rakudo​: my $a = 1, 2, 3; |$a.say;
<p6eval> rakudo 7ef386​: 123␤
<JimmyZ> hmm, that's used to flatten args.
<masak> rakudo​: my @​a = 1, 2, 3; my $a = |@​a
<p6eval> rakudo 7ef386​: too many positional arguments​: 4 passed, 2
expected [...]
<masak> JimmyZ​: yes, exactly. but assignment is not a call.
<JimmyZ> yes
<masak> so those are not args.
<JimmyZ> rakudo​: my $a = 1, 2, 3; my @​b = (|$a) ; @​b.perl.say;
<p6eval> rakudo 7ef386​: [[1, 2, 3]]␤
<masak> I'll just pre-emptively submit it as a bug, and we'll see what happens.
* masak submits
<JimmyZ> it'd be a bug.
<masak> at the very least, it's less than... clear what happens. :)

@p6rt
Copy link
Author

p6rt commented Jan 21, 2011

From @coke

Output has changed​:

On Thu Dec 03 19​:17​:58 2009, masak wrote​:

<masak> rakudo​: my $a = 1, 2, 3; my @​a = |$a; say @​a.perl
<p6eval> rakudo 7ef386​: too many positional arguments​: 4 passed, 2
expected [...]

[\(1)]

<masak> uh.
<masak> did I just confuse the assignment builtin?
<JimmyZ> rakudo​: my $a = 1, 2, 3; |$a.say;
<p6eval> rakudo 7ef386​: 123␤

1

<JimmyZ> hmm, that's used to flatten args.
<masak> rakudo​: my @​a = 1, 2, 3; my $a = |@​a
<p6eval> rakudo 7ef386​: too many positional arguments​: 4 passed, 2
expected [...]

Capture()<0x10d76dd60>

<masak> JimmyZ​: yes, exactly. but assignment is not a call.
<JimmyZ> yes
<masak> so those are not args.
<JimmyZ> rakudo​: my $a = 1, 2, 3; my @​b = (|$a) ; @​b.perl.say;
<p6eval> rakudo 7ef386​: [[1, 2, 3]]␤

[\(1)]

<masak> I'll just pre-emptively submit it as a bug, and we'll see what
happens.
* masak submits
<JimmyZ> it'd be a bug.
<masak> at the very least, it's less than... clear what happens. :)

Is this better?

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 21, 2011

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

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

All of those now fail with​:

16​:29 <p6eval> rakudo 024843​: OUTPUT«===SORRY!===␤CHECK
FAILED​:␤Undefined routine
  '&prefix​:<|>' called (line 1)␤»

@p6rt
Copy link
Author

p6rt commented Apr 6, 2015

From @jnthn

On Thu Dec 03 19​:17​:58 2009, masak wrote​:

<masak> rakudo​: my $a = 1, 2, 3; my @​a = |$a; say @​a.perl
<p6eval> rakudo 7ef386​: too many positional arguments​: 4 passed, 2
expected [...]
<masak> uh.
<masak> did I just confuse the assignment builtin?

These days this gives a useful error​:

$ perl6-m -e "my $a = 1, 2, 3; my @​a = |$a; say @​a.perl"
===SORRY!=== Error while compiling -e
Arg-flattening | is only valid in an argument list
at -e​:1
------> my $a = 1, 2, 3; my @​a = |<HERE>$a; say @​a.perl

Added a test in S32-exceptions/misc.t; resolving.

@p6rt
Copy link
Author

p6rt commented Apr 6, 2015

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

@p6rt p6rt closed this as completed Apr 6, 2015
@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