Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement Parcel.iterator & fix build
  • Loading branch information
sorear committed Jul 20, 2010
1 parent e06200c commit b6fa476
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion setting
Expand Up @@ -431,9 +431,29 @@ my class EMPTY { }
my class Parcel {
# $!ll
method iterator() {
my $ll = $!ll;
my $it = Iterator.RAWCREATE("valid", 1, "value", EMPTY, "next", Any);
my $ix = $ll.elems - 1;
while $ix >= 0 {
$it = Iterator.RAWCREATE("valid", 1, "next", $it);
Q:CgOp {
(prog
[setindex value (getfield slots
(cast DynObject (@ (l $it))))
(methodcall (l $ll) at-pos (l $ix))]
[null Variable])
};
$ix--;
}

$it;
}
}

sub infix:<,>(*@bits) {
sub infix:<,>(*@v) {
my @r := Parcel.RAWCREATE("ll", Q:CgOp { (varattr rest (@ (l @v))) });
@r;
}
Expand Down

0 comments on commit b6fa476

Please sign in to comment.