Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Convert instances of 1.Bool into Bool::True.

  • Loading branch information...
commit 701964259a27074cf601594858ded6b2f87d389f 1 parent e77b738
Patrick R. Michaud pmichaud authored
4 src/core/Any.pm
View
@@ -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 }
2  src/core/Array.pm
View
@@ -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) {
4 src/core/Bool.pm
View
@@ -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 }
}
14 src/core/IO.pm
View
@@ -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(|$) {
@@ -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',
@@ -43,7 +43,7 @@ class IO {
method close() {
# TODO:b catch errors
$!PIO.close;
- 1.Bool;
+ Bool::True;
}
method eof() {
@@ -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();
@@ -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);
}
4 src/core/List.pm
View
@@ -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 }
@@ -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(|$) {
4 src/core/Parcel.pm
View
@@ -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; }
@@ -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
2  src/core/Range.pm
View
@@ -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 }
Please sign in to comment.
Something went wrong with that request. Please try again.