UFCS
Uniform Function Call Syntax lets you call any function using dot notation on its first argument. There are no methods or impl blocks in pyr - just regular functions that chain naturally.
Any function can be called with dot syntax on its first argument. No methods, no impl blocks. |
|
These two calls are identical. |
|
Chaining works naturally. |
|
Multi-argument functions work too. The dot target becomes the first argument, the rest follow in parens. |
|
Builtins work with UFCS too. |
|
String builtins chain cleanly. |
|
$ pyr run ufcs.pyr 10 10 -10 7 7 10 10 true 2 [1, 4] HELLO PYR a - b - c |