Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
15
Task/Function-definition/YAMLScript/function-definition.ys
Normal file
15
Task/Function-definition/YAMLScript/function-definition.ys
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
!yamlscript/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue