Control Functions.pfunc
Overloads a callable by a condition and a body.
Arguments
conditionBody
to evaluate on each call.body
is the code to overload a callable with.
Return values
The resulting
callable
. If the condition
evaluates to FALSE or leads to an error, the error will be suppressed, and an old overload will be called. If the condition
evaluates to TRUE, the new overload will be called. In particular, pfunc
can be used for pattern matching, where possible variants will be checked starting from the last one.
Example
Output:
3
3.000000
b test:
348
9
64
52
0
0
58
58