In IO::Path§
See primary documentation in context for method pred
method pred(IO::Path: --> IO::Path)
Returns a new IO::Path
constructed from the invocant, with .basename
changed by calling Str.pred
on it.
"foo/file02.txt".IO.pred.say; # OUTPUT: «"foo/file01.txt".IO»
In enum Bool§
See primary documentation in context for routine pred
method pred(--> Bool)
Returns False
.
say True.pred; # OUTPUT: «False»say False.pred; # OUTPUT: «False»
pred
is short for "predecessor"; it returns the previous enum value. Bool is a special enum with only two values, False
and True
. When sorted, False
comes first, so False
is the predecessor to True
. And since False
is the "lowest" Bool enum value, its own predecessor is also False
.
In Date§
See primary documentation in context for method pred
method pred(Date: --> Date)
Returns a Date
of the previous day. "pred" is short for "predecessor".
say Date.new("2016-01-01").pred; # OUTPUT: «2015-12-31»
In role Numeric§
See primary documentation in context for method pred
method pred(Numeric:)
Returns the number decremented by one (predecessor).
In role Enumeration§
See primary documentation in context for method pred
method pred(::?CLASS:)
say Freija.pred; # OUTPUT: «Oðin»
In Str§
See primary documentation in context for method pred
method pred(Str: --> Str)
Returns the string decremented by one.
String decrementing is "magical" just like string increment (see succ). It fails on underflow
'b0'.pred; # OUTPUT: «a9»'a0'.pred; # OUTPUT: Failure'img002.png'.pred; # OUTPUT: «img001.png»
In Allomorph§
See primary documentation in context for method pred
method pred(Allomorph:)
Calls Numeric.pred
on the invocant's numeric value.