2020-12-12 20:33:53 +00:00
|
|
|
(ns examples.hello-world)
|
|
|
|
|
2020-12-25 00:58:28 +00:00
|
|
|
|
2020-12-24 16:28:12 +00:00
|
|
|
(def hello-world
|
2020-12-25 00:58:28 +00:00
|
|
|
(fn (name)
|
2020-12-25 01:18:46 +00:00
|
|
|
(println "hello" name)))
|
2020-12-24 16:28:12 +00:00
|
|
|
|
2021-01-03 23:42:49 +00:00
|
|
|
(def a1
|
|
|
|
(fn (x y)
|
|
|
|
x))
|
|
|
|
|
2020-12-25 01:40:13 +00:00
|
|
|
(defmacro defn
|
|
|
|
(name args &body)
|
2021-01-03 23:42:49 +00:00
|
|
|
(list 'do
|
2021-01-10 17:03:52 +00:00
|
|
|
(list 'def name (cons 'fn (list args body)))))
|
2020-12-25 01:40:13 +00:00
|
|
|
|
2020-12-30 17:50:00 +00:00
|
|
|
(defn pp (x y)
|
2021-01-10 17:03:52 +00:00
|
|
|
(asd)
|
2020-12-25 01:40:13 +00:00
|
|
|
(println x))
|
|
|
|
|
2021-01-10 17:03:52 +00:00
|
|
|
(macroexpand '(pp 33 22))
|
2020-12-24 16:28:12 +00:00
|
|
|
(def main
|
2021-01-10 17:03:52 +00:00
|
|
|
(fn ()
|
2021-01-03 23:42:49 +00:00
|
|
|
(pp "sam" 2)
|
2020-12-25 01:18:46 +00:00
|
|
|
(hello-world "world")))
|