Skip to content

Commit

Permalink
Convert instances of 1.Bool into Bool::True.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jul 5, 2011
1 parent e77b738 commit 7019642
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/core/Any.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ my class Any {
# List-like methods for Any.
########

method eager() { nqp::p6list(nqp::list(self), List, 1.Bool).eager }
method eager() { nqp::p6list(nqp::list(self), List, Bool::True).eager }
method elems() { self.list.elems }
method infinite() { Mu }
method flat() { nqp::p6list(nqp::list(self), List, 1.Bool) }
method flat() { nqp::p6list(nqp::list(self), List, Bool::True) }
method hash() { my %h = self }
method list() { nqp::p6list(nqp::list(self), List, Mu) }
method reverse() { self.list.reverse }
Expand Down
2 changes: 1 addition & 1 deletion src/core/Array.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Array {
method new(|$) {
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
nqp::p6list($args, self.WHAT, 1.Bool);
nqp::p6list($args, self.WHAT, Bool::True);
}

method at_pos($pos is copy) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Bool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ my class Bool {

method Numeric() { self ?? 1 !! 0 }

method pred() { 0.Bool }
method pred() { Bool::False }

method succ() { 1.Bool }
method succ() { Bool::True }

method ACCEPTS(Mu \$topic) { self }
}
Expand Down
14 changes: 7 additions & 7 deletions src/core/IO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# But you should see what USED to be here! O.O
sub print(*@list) {
$*OUT.print(@list.shift) while @list.gimme(1);
1.Bool
Bool::True
}

sub say(|$) {
Expand All @@ -24,10 +24,10 @@ sub gist(|$) {
class IO {
has $!PIO;
has Int $.ins = 0;
has $.chomp = 1.Bool;
has $.chomp = Bool::True;

proto method open(|$) { * }
multi method open($filename, :$r, :$w, :$a, :$bin, :$chomp = 1.Bool) {
multi method open($filename, :$r, :$w, :$a, :$bin, :$chomp = Bool::True) {
my $mode = $w ?? 'w' !! ($a ?? 'wa' !! 'r');
# TODO: catch error, and fail()
nqp::bindattr(self, IO, '$!PIO',
Expand All @@ -43,7 +43,7 @@ class IO {
method close() {
# TODO:b catch errors
$!PIO.close;
1.Bool;
Bool::True;
}

method eof() {
Expand Down Expand Up @@ -72,7 +72,7 @@ class IO {

method print(*@list) {
$!PIO.print(nqp::unbox_s(@list.shift.Str)) while @list.gimme(1);
1.Bool
Bool::True
}
method say(|$) {
my Mu $args := pir::perl6_current_args_rpa__P();
Expand All @@ -86,11 +86,11 @@ sub unlink($filename) {
try {
pir::new__PS('OS').rm($filename);
}
$! ?? fail($!) !! 1.Bool
$! ?? fail($!) !! Bool::True
}

proto sub open(|$) { * }
multi sub open($filename, :$r, :$w, :$a, :$bin, :$chomp = 1.Bool) {
multi sub open($filename, :$r, :$w, :$a, :$bin, :$chomp = Bool::True) {
IO.new.open($filename, :$r, :$w, :$a, :$bin, :$chomp);
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class List does Positional {

method flat() { self.flattens
?? self
!! nqp::p6list(nqp::list(self), List, 1.Bool)
!! nqp::p6list(nqp::list(self), List, Bool::True)
}
method list() { self }
method flattens() { $!flattens }
Expand Down Expand Up @@ -187,7 +187,7 @@ sub eager(|$) {
}

sub flat(|$) {
nqp::p6list(pir::perl6_current_args_rpa__P(), List, 1.Bool)
nqp::p6list(pir::perl6_current_args_rpa__P(), List, Bool::True)
}

sub list(|$) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Parcel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ my class Parcel does Positional {
method Numeric() { self.flat.elems }

method flat() {
nqp::p6list(nqp::clone($!storage), List, 1.Bool)
nqp::p6list(nqp::clone($!storage), List, Bool::True)
}

method item() { my $v = self; }
Expand Down Expand Up @@ -50,7 +50,7 @@ my class Parcel does Positional {
# get the list of rvalues to store and lhs containers
my Mu $args := pir::perl6_current_args_rpa__P();
nqp::shift($args);
my $rhs := nqp::p6list($args, List, 1.Bool); # XXX this might need to be Seq
my $rhs := nqp::p6list($args, List, Bool::True); # XXX this might need to be Seq

# first pass -- scan lhs containers and pick out
# scalar versus list assignment. This also reifies
Expand Down
2 changes: 1 addition & 1 deletion src/core/Range.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Range is Iterable does Positional {
self;
}

method flat() { nqp::p6list(nqp::list(self), List, 1.Bool) }
method flat() { nqp::p6list(nqp::list(self), List, Bool::True) }
method infinite() { $.max == $Inf }
method iterator() { self }
method list() { self.flat }
Expand Down

0 comments on commit 7019642

Please sign in to comment.