File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -1113,15 +1113,13 @@ Throws C<X::Cannot::Capture>.
1113
1113
1114
1114
= head2 routine val
1115
1115
1116
- multi sub val(Str:D $MAYBEVAL, :$val-or-fail )
1116
+ multi sub val(Str:D $MAYBEVAL)
1117
1117
1118
1118
Given a C < Str > that may be parsable as a numeric value, it will
1119
1119
attempt to construct the appropriate L < allomorph|/language/glossary#Allomorph > ,
1120
1120
returning one of L < IntStr|/type/IntStr > , L < NumStr|/type/NumStr > , L < RatStr|/type/RatStr >
1121
1121
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.
1125
1123
1126
1124
say val("42").^name; # OUTPUT: «IntStr»
1127
1125
say val("42e0").^name; # OUTPUT: «NumStr»
You can’t perform that action at this time.
0 commit comments