Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Call-a-function/WDTE/call-a-function.wdte
Normal file
20
Task/Call-a-function/WDTE/call-a-function.wdte
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
let noargs => + 2 5;
|
||||
noargs -- print;
|
||||
|
||||
let fixedargs a b => + a b;
|
||||
fixedargs 3 5 -- print;
|
||||
|
||||
let m => import 'math';
|
||||
m.cos 3 -- print;
|
||||
|
||||
# WDTE only has expressions, not statements, so statement vs.
|
||||
# first-class context doesn't make sense.
|
||||
|
||||
# Arguments in WDTE are technically passed by reference, in a way, but
|
||||
# because it's a functional language and everything's immutable
|
||||
# there's no real usability difference from that.
|
||||
|
||||
# Partial application is possible. For example, the following
|
||||
# evaluates `+ 3` and then passes 7 to the resulting partially applied
|
||||
# function.
|
||||
(+ 3) 7 -- print;
|
||||
Loading…
Add table
Add a link
Reference in a new issue