Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make .infinite return Nil rather than Bool/Mu when it doesn't know
<TimToady> .tell lizmat These days Nil is considered the best way to indicate "missing information"
  • Loading branch information
lizmat committed Jul 21, 2013
1 parent 4a977dc commit 364e2a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/Iterable.pm
@@ -1,6 +1,6 @@
my class Iterable {
method elems() { self.list.elems }
method infinite() { Mu }
method infinite() { Nil }
method item($self:) { $self }

method fmt($format = '%s', $separator = ' ') {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ListIter.pm
Expand Up @@ -64,7 +64,7 @@ my class ListIter {
$!rest
?? nqp::istype(nqp::atpos($!rest, 0), Iterable)
&& nqp::atpos($!rest,0).infinite
|| Bool
|| Nil
!! Bool::False
}

Expand Down

0 comments on commit 364e2a3

Please sign in to comment.