FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
aviatorscript/examples/function_first_class.av at master · all-amazing/aviatorscript · GitHub
all-amazing
/
aviatorscript
Public
forked from
killme2008/aviatorscript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
aviatorscript
/
examples
/
function_first_class.av
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (22 loc) · 396 Bytes
Breadcrumbs
aviatorscript
/
examples
/
function_first_class.av
Copy path
File metadata and controls
28 lines (22 loc) · 396 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## examples/function_first_class.av
fn square(x) {
return x * 2;
}
let add = lambda(x, y, f) ->
f(x) + f(y)
end;
let add_n = lambda(x) ->
lambda(y) ->
x + y
end
end;
println(type(square));
println(type(add));
println(type(add_n));
let s = add(1, 2, square);
println(s);
let add_3 = add_n(3);
println(type(add_3));
println(add_3(1));
println(add_3(99));
println(add_3(' test'));
Back
|
FazBrowse Home
|
New Git URL