Skip to content

Commit acab715

Browse files
committed
Remove documentation of "val-or-fail"
This is an untested documentation detail of val() processing and a hack to use the same code for numerification of strings.
1 parent 2b52179 commit acab715

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

doc/Type/Str.pod6

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,15 +1113,13 @@ Throws C<X::Cannot::Capture>.
11131113
11141114
=head2 routine val
11151115
1116-
multi sub val(Str:D $MAYBEVAL, :$val-or-fail)
1116+
multi sub val(Str:D $MAYBEVAL)
11171117
11181118
Given a C<Str> that may be parsable as a numeric value, it will
11191119
attempt to construct the appropriate L<allomorph|/language/glossary#Allomorph>,
11201120
returning one of L<IntStr|/type/IntStr>, L<NumStr|/type/NumStr>, L<RatStr|/type/RatStr>
11211121
or L<ComplexStr|/type/ComplexStr> or a plain C<Str> if a numeric value cannot
1122-
be parsed. If the C<:val-or-fail> adverb is provided it will return an
1123-
L<X::Str::Numeric|/type/X::Str::Numeric> rather than the original string if it
1124-
cannot parse the string as a number.
1122+
be parsed.
11251123
11261124
say val("42").^name; # OUTPUT: «IntStr␤»
11271125
say val("42e0").^name; # OUTPUT: «NumStr␤»

0 commit comments

Comments
 (0)