|
!YS-v0
|
|
|
|
# Main function definition with variable arguments:
|
|
defn main(*args):
|
|
say: "multiply($(args.join(', ')))
|
|
-> $multiply(args*)"
|
|
|
|
# A multi-arity function definition:
|
|
defn multiply:
|
|
(): 1
|
|
(x): x
|
|
(x y): x * y
|
|
(x y *more):
|
|
reduce multiply:
|
|
multiply(x y) more
|