develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33684 - branches/assign/languages/perl6/src/builtins

From:
pmichaud
Date:
December 8, 2008 18:53
Subject:
[svn:parrot] r33684 - branches/assign/languages/perl6/src/builtins
Message ID:
20081209025336.03D2FCB9AF@x12.develooper.com
Author: pmichaud
Date: Mon Dec  8 18:53:30 2008
New Revision: 33684

Modified:
   branches/assign/languages/perl6/src/builtins/assign.pir

Log:
[rakudo]:  Fix array assignment where array appears on rhs.


Modified: branches/assign/languages/perl6/src/builtins/assign.pir
==============================================================================
--- branches/assign/languages/perl6/src/builtins/assign.pir	(original)
+++ branches/assign/languages/perl6/src/builtins/assign.pir	Mon Dec  8 18:53:30 2008
@@ -59,9 +59,9 @@
     .tailcall 'infix:='(cont, source)
 
   cont_array:
-    .local pmc list, it
+    .local pmc list, it, array
     ## empty the array
-    assign cont, 0
+    array = new 'ResizablePMCArray'
     source = 'list'(source)
     it = iter source
   array_loop:
@@ -69,9 +69,11 @@
     $P0 = shift it
     $P0 = $P0.'Scalar'()
     $P0 = clone $P0
-    push cont, $P0
+    push array, $P0
     goto array_loop
   array_done:
+    $I0 = elements cont
+    splice cont, array, 0, $I0
     .return (cont)
 .end
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About