Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Call .Bool instead of .true for truthiness. Doesn't actually call .Bo…
…ol for user-defined classes, though?
  • Loading branch information
tene committed Dec 7, 2009
1 parent 698534c commit 417a990
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/builtins/Junction.pir
Expand Up @@ -125,14 +125,14 @@ Return perl representation. (This should actually be autothreaded.)
.end


=item true()
=item Bool()

Evaluate Junction as a boolean.

=cut

.namespace ['Junction']
.sub 'true' :method
.sub 'Bool' :method
.local pmc eigenstates, it
.local int type
eigenstates = self.'eigenstates'()
Expand Down Expand Up @@ -247,7 +247,7 @@ Return the components of the Junction.

.namespace ['Junction']
.sub '' :method :vtable('get_bool')
$I0 = self.'true'()
$I0 = self.'Bool'()
.return ($I0)
.end

Expand Down
4 changes: 2 additions & 2 deletions src/builtins/ListIterator.pir
Expand Up @@ -42,13 +42,13 @@ returns a Failure.
.end


=item true()
=item Bool()

Returns true if the iterator has not reached the end of the list.

=cut

.sub 'true' :method
.sub 'Bool' :method
.local pmc list, index, values
list = getattribute self, '$!list'
index = getattribute self, '$!index'
Expand Down
2 changes: 1 addition & 1 deletion src/builtins/Mu.pir
Expand Up @@ -461,7 +461,7 @@ Gets the object's identity value
.end
.sub '' :vtable('get_bool') :method
$I0 = self.'true'()
$I0 = self.'Bool'()
.return ($I0)
.end
Expand Down
2 changes: 1 addition & 1 deletion src/core/Mu.pm
@@ -1,5 +1,5 @@
augment class Mu {
method true { $.defined }
method Bool { $.defined }

multi method notdef() { !self.defined; }
}

0 comments on commit 417a990

Please sign in to comment.