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
|
|
|
|
2020-12-25 01:40:13 +00:00
|
|
|
(defmacro defn
|
|
|
|
(name args &body)
|
|
|
|
(list 'def name (cons 'fn (cons args body))))
|
|
|
|
|
|
|
|
(defn pp (x)
|
|
|
|
(println x))
|
|
|
|
|
2020-12-24 16:28:12 +00:00
|
|
|
(def main
|
|
|
|
(fn (&args)
|
2020-12-25 01:40:13 +00:00
|
|
|
(pp "sam")
|
2020-12-25 01:18:46 +00:00
|
|
|
(hello-world "world")))
|