Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Start throwing iterator example code into List.pm. Compiles b…
…ut not tested or used for anything." because it appears to break ng badly.

This reverts commit 8aedd0c.
  • Loading branch information
colomon committed Jan 23, 2010
1 parent 8aedd0c commit 9174831
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/core/List.pm
Expand Up @@ -18,37 +18,4 @@ augment class List {
}
}

# Throw together an iterator interface, just so we have something to talk about

role Iterator {
multi method get() {
Nil; # probably should use a special terminator instead
}

multi method list() {
self;
}
}

class ScalarIterator does Iterator {
has $.value;
has $.done;

multi method new($value) {
self.bless(*, :value($value),
:done(Bool::False));
}

multi method get() {
if $.done {
Nil;
}
else {
$.done = Bool::True;
$.value;
}
}
}


# vim: ft=perl6

0 comments on commit 9174831

Please sign in to comment.