Skip to content

Commit

Permalink
implement Iterator.Bool, so that "if @things.grep($tester)" works pro…
Browse files Browse the repository at this point in the history
…perly. Fixes RT #74056
  • Loading branch information
moritz committed Apr 5, 2010
1 parent 4d1b1c7 commit ebb9f47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/builtins/Iterator.pir
Expand Up @@ -88,6 +88,14 @@ continue until memory is exhausted.
.tailcall $P0.'postcircumfix:<[ ]>'(args :flat, adverbs :flat :named)
.end
.namespace ['Iterator']
.sub 'Bool' :method :vtable('get_bool')
.local pmc item
item = self.'get'()
$I0 = isa item, ['EMPTY']
.tailcall '&prefix:<!>'($I0)
.end
=back
=cut
Expand Down

0 comments on commit ebb9f47

Please sign in to comment.