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

loop with two comma-separated 'my' variable initialisations doesn't parse in Rakudo #1016

Closed
p6rt opened this issue May 24, 2009 · 6 comments

Comments

@p6rt
Copy link

p6rt commented May 24, 2009

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

Searchable as RT65962$

@p6rt
Copy link
Author

p6rt commented May 24, 2009

From @masak

<TimToady> rakudo​: loop (my $a = 1, my $b = 2; $a < 5; $a++, $b++) {
say "$a $b" }
<p6eval> rakudo 23718a​: OUTPUT«Unable to set lvalue on PAST​::Val node [...]
<TimToady> that oughta work
* masak reports rakudobug
<TimToady> it's not because rakudo is parsing it as a list assignment
<TimToady> (a known bug, iirc)
* masak searches
<masak> nope, a cursort glance at a search for 'loop' & queue=perl6
does not yield anything substantial. reporting just in case.
<masak> rakudo​: loop (my $a = 1, my $b = 2;0;) { say "$a $b" }
<p6eval> rakudo 23718a​: OUTPUT«Unable to set lvalue on PAST​::Val node [...]

@p6rt
Copy link
Author

p6rt commented Aug 2, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S04-statements/loop.t

commit e88ffdae99b59cb7c743e3a60f774e173a3409ad
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Aug 2 20​:38​:23 2009 +0000

  [t/spec] Test for RT #​65962
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;27856 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S04-statements/loop.t b/t/spec/S04-statements/loop.t
index 86b9001..a5bd99a 100644
--- a/t/spec/S04-statements/loop.t
+++ b/t/spec/S04-statements/loop.t
@@ -11,7 +11,7 @@ loop statement tests
 
 =end kwid
 
-plan 11;
+plan 12;
 
 # basic loop
 
@@ -82,4 +82,15 @@ plan 11;
     is($loopvar, 3, "bare loop exited after 3 iterations");
 }
 
+#?rakudo skip 'RT #65962'
+{
+    my $rt65962 = 'did not loop';
+    
+    loop ( my $a = 1, my $b = 2; $a < 5; $a++, $b++ ) {
+        $rt65962 = "$a $b";
+    }
+
+    is $rt65962, '4 5', 'loop with two variables in init works';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Aug 2, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

From @masak

Now with a new and not-much-friendlier error message!

<masak> std​: loop (my $a = 1, my $b = 2; $a < 5; $a++, $b++) { say "$a
$b" }
<p6eval> std 30139​: OUTPUT«ok 00​:01 107m␤»
<masak> rakudo​: loop (my $a = 1, my $b = 2; $a < 5; $a++, $b++) { say
"$a $b" }
<p6eval> rakudo 6c8737​: OUTPUT«Undefined value shifted from empty
array [...]

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

From @jnthn

On Sun May 24 14​:44​:40 2009, masak wrote​:

<TimToady> rakudo​: loop (my $a = 1, my $b = 2; $a < 5; $a++, $b++) {
say "$a $b" }
<p6eval> rakudo 23718a​: OUTPUT«Unable to set lvalue on PAST​::Val node
[...]
<TimToady> that oughta work
* masak reports rakudobug
<TimToady> it's not because rakudo is parsing it as a list assignment
<TimToady> (a known bug, iirc)
* masak searches
<masak> nope, a cursort glance at a search for 'loop' & queue=perl6
does not yield anything substantial. reporting just in case.
<masak> rakudo​: loop (my $a = 1, my $b = 2;0;) { say "$a $b" }
<p6eval> rakudo 23718a​: OUTPUT«Unable to set lvalue on PAST​::Val node
[...]

Works now and test in loop.t is enabled (plus many others for item
assignment parsing in assign.t); resolving ticket.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

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

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