Skip to content

Commit 8ac934b

Browse files
committed
Document .Bool on allomorphs
In Rakudo, this method is not actually implemented in allomorphs itself and it's inherited, but in the docs it's hard to see whether the .Bool comes from Str or Numeric portion. Spec: Raku/roast@4fab1d3d7c Discussion: https://irclog.perlgeek.de/perl6-dev/2018-02-23#i_15851777
1 parent e20ad33 commit 8ac934b

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

doc/Type/ComplexStr.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ directly the values can be whatever is required:
3636
say +$f; # OUTPUT: «42+0i␤»
3737
say ~$f; # OUTPUT: «"forty two (but complicated)"␤»
3838
39+
=head2 method Bool
40+
41+
Defined as:
42+
43+
multi method Bool(ComplexStr:D: --> Bool:D)
44+
45+
I<This method may be provided by the parent classes and not implemented in ComplexStr directly>.
46+
47+
Returns C<True> if the invocant is numerically C<±0±0i>, otherwise returns C<True>. String portion
48+
is not considered.
49+
3950
=head2 method Capture
4051
4152
Defined as:

doc/Type/IntStr.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ directly the values can be whatever is required:
3535
say +$f; # OUTPUT: «42␤»
3636
say ~$f; # OUTPUT: «"forty two"␤»
3737
38+
=head2 method Bool
39+
40+
Defined as:
41+
42+
multi method Bool(IntStr:D: --> Bool:D)
43+
44+
I<This method may be provided by the parent classes and not implemented in IntStr directly>.
45+
46+
Returns C<True> if the invocant is numerically C<0>, otherwise returns C<True>. String portion
47+
is not considered.
48+
3849
=head2 method Int
3950
4051
method Int

doc/Type/NumStr.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ directly the values can be whatever is required:
3535
say +$f; # OUTPUT: «42.1␤»
3636
say ~$f; # OUTPUT: «"forty two and a bit"␤»
3737
38+
=head2 method Bool
39+
40+
Defined as:
41+
42+
multi method Bool(NumStr:D: --> Bool:D)
43+
44+
I<This method may be provided by the parent classes and not implemented in NumStr directly>.
45+
46+
Returns C<True> if the invocant is numerically C<±0e0>, otherwise returns C<True>. String portion
47+
is not considered.
48+
3849
=head2 method Num
3950
4051
method Num

doc/Type/RatStr.pod6

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ directly the values can be whatever is required:
3535
say +$f; # OUTPUT: «42.1␤»
3636
say ~$f; # OUTPUT: «"forty two and a bit"␤»
3737
38+
=head2 method Bool
39+
40+
Defined as:
41+
42+
multi method Bool(RatStr:D: --> Bool:D)
43+
44+
I<This method may be provided by the parent classes and not implemented in RatStr directly>.
45+
46+
Returns C<True> if the numerator is the numeric portion is C<0>, otherwise returns C<True>.
47+
This applies for C«< 0/0 >» zero-denominator L<RatStr> as well, despite C«?< 0/0 >.Num» being
48+
C<True>. String portion is not considered.
49+
3850
=head2 method Capture
3951
4052
Defined as:

0 commit comments

Comments
 (0)