Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
double = [1,2,3].map (x) -> x*2
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn = -> return 8
|
||||
sum = (a, b) -> a() + b()
|
||||
sum(fn, fn) # => 16
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
bowl = ["Cheese", "Tomato"]
|
||||
|
||||
smash = (ingredient) ->
|
||||
return "Smashed #{ingredient}"
|
||||
|
||||
contents = smash ingredient for ingredient in bowl
|
||||
# => ["Smashed Cheese", "Smashed Tomato"]
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
double = (x) -> x*2
|
||||
triple = (x) -> x*3
|
||||
addOne = (x) -> x+1
|
||||
|
||||
addOne triple double 2 # same as addOne(triple(double(2)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(-> -> -> -> 2 )()()()() # => 2
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
((x)->
|
||||
2 + x(-> 5)
|
||||
)((y) -> y()+3)
|
||||
# result: 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue