mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
19 lines
390 B
Plaintext
19 lines
390 B
Plaintext
(defn my-curry [f] (fn [x] (fn [y] (f x y))))
|
|
(defn double-curry [f] (fn [x] (fn [y] (fn [z] (f x y z)))))
|
|
|
|
(defn make-cb []
|
|
((fn []
|
|
(let [x "hi"]
|
|
(fn [] (IO.println x))))))
|
|
|
|
(defn make-cb2 []
|
|
((fn []
|
|
(let [x "hello"
|
|
f (fn [] (IO.println x))]
|
|
f))))
|
|
|
|
(defn main []
|
|
(do ((make-cb))
|
|
((make-cb2))
|
|
(((my-curry (fn [x y] (Int.+ x y))) 1) 2)))
|