Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
func apply(fun, x) { y => fun(x, y) }
|
||||
|
||||
func sum(x, y) { x + y }
|
||||
|
||||
let sum2 = apply(sum, 2)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func sum(x, y) { x + y }
|
||||
func doubleMe(x) { x + x }
|
||||
|
||||
var arr = []
|
||||
arr.Add(sum)
|
||||
arr.Add(doubleMe)
|
||||
arr.Add(arr.ToString)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func Iterator.Filter(pred) {
|
||||
for x in this when pred(x) {
|
||||
yield x
|
||||
}
|
||||
}
|
||||
|
||||
[1,2,3,4,5].Iterate().Filter(x => x % 2 == 0)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func flip(fun, x, y) {
|
||||
(y, x) => fun(x, y)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue