Author: jonathan
Date: Wed Aug 20 10:32:33 2008
New Revision: 30387
Modified:
branches/lazyrakudo/languages/perl6/src/classes/Array.pir
branches/lazyrakudo/languages/perl6/src/classes/List.pir
Log:
[rakudo] Various bug fixes to assignment and list creation, which gets us able
to run through make test without any hangs.
Modified: branches/lazyrakudo/languages/perl6/src/classes/Array.pir
==============================================================================
--- branches/lazyrakudo/languages/perl6/src/classes/Array.pir (original)
+++ branches/lazyrakudo/languages/perl6/src/classes/Array.pir Wed Aug 20
10:32:33 2008
@@ -23,7 +23,9 @@
.param pmc source
$P0 = get_hll_global 'list'
$P0 = $P0(source)
- setattribute $P0, "@!unevaluated", $P0
+ setattribute self, "@!unevaluated", $P0
+ $P0 = new 'ResizablePMCArray'
+ setattribute self, "@!evaluated", $P0
.return (self)
.end
Modified: branches/lazyrakudo/languages/perl6/src/classes/List.pir
==============================================================================
--- branches/lazyrakudo/languages/perl6/src/classes/List.pir (original)
+++ branches/lazyrakudo/languages/perl6/src/classes/List.pir Wed Aug 20
10:32:33 2008
@@ -152,7 +152,7 @@
.sub 'shift_pmc' :vtable
.local pmc value
.local int elems_available
-say "in shift_pmc"
+
# See if we have anything in the evaluated part.
.local pmc evaluated
evaluated = getattribute self, "@!evaluated"
@@ -310,7 +310,7 @@
.sub '!evaluate_upto' :method
.param int required
-
+
# Get the parts of the list and see what we have and what's available.
.local pmc evaluated, unevaluated
.local int have, available
@@ -325,7 +325,9 @@
if have > required goto loop_end
.local pmc try
try = unevaluated[0]
- $I0 = isa try, 'Perl6Iterator'
+ $I0 = isa try, 'Range'
+ if $I0 goto have_iter
+ $I0 = isa try, 'IOIterator'
if $I0 goto have_iter
try = shift unevaluated
push evaluated, try
@@ -386,6 +388,18 @@
.end
+=item get_string() (vtable method)
+
+Return the elements of the list joined by spaces.
+
+=cut
+
+.sub 'get_string' :vtable :method
+ $S0 = join ' ', self
+ .return ($S0)
+.end
+
+
=back
=head2 Methods added to ResizablePMCArray
@@ -474,7 +488,7 @@
.namespace []
.sub 'list'
.param pmc values :slurpy
- values = values.'!flatten'()
+ values.'!flatten'()
.local pmc list
list = new 'List'
setattribute list, "@!unevaluated", values
@@ -490,7 +504,8 @@
.sub 'infix:,'
.param pmc args :slurpy
- args = args.'!flatten'()
+ $I0 = elements args
+ args.'!flatten'()
.local pmc list
list = new 'List'
setattribute list, "@!unevaluated", args
@@ -501,18 +516,6 @@
################# Below here to review for lazy conversion. #################
-=item get_string() (vtable method)
-
-Return the elements of the list joined by spaces.
-
-=cut
-
-.sub 'get_string' :vtable :method
- $S0 = join ' ', self
- .return ($S0)
-.end
-
-
=item hash()
Return the List invocant as a Hash.