1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/examples/clojurewest2014.mal
2017-09-15 20:00:15 +02:00

3.2 KiB
Executable File

")))
 
(def! bold
(fn* (s)
(str "" s "")))
 
(def! blue
(fn* (s)
(str "" s "")))
 
(def! title
(fn* (s)
(bold (blue (str s "\n")))))
 
(def! title2
(fn* (s)
(bold (blue s))))
 
 
(def! conj-slides
(list
(list
(title2 " __ __ _ _")
(title2 "| \\/ | / \\ | |")
(title2 "| |\\/| | / _ \\ | | ")
(title2 "| | | |/ ___ \\| |___ ")
(title2 "|_| |_/_/ \\_\\_____|"))
(list
(title "gherkin")
"- a lisp1 written in bash4")
(list
(title "mal - an interpreter for a subset of Clojure"))
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make")
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make"
"- and Bash 4")
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make"
"- and Bash 4"
"- and Javascript")
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make"
"- and Bash 4"
"- and Javascript"
"- and Python")
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make"
"- and Bash 4"
"- and Javascript"
"- and Python"
"- and Clojure")
(list
(title "mal - an interpreter for a subset of Clojure")
"- written in GNU make"
"- and Bash 4"
"- and Javascript"
"- and Python"
"- and Clojure"
"- and C and Java and PHP")
(list
(title "things it has")
"- scalars: integers, strings, symbols, nil, true, false"
"- immutable collections: lists, vectors, hash-maps"
"- metadata, atoms"
"- def!, fn*, let*"
" - varargs: (fn* (x y & more) ...)"
"- tail call optimization"
" - except GNU make implementation (no iteration)"
"- macros (quote, unquote, quasiquote, splice-quote)"
"- almost 300 unit tests"
"- REPL with readline (GNU readline or libedit)")
(list
(title "things it does not have")
"- performance"
"- namespaces"
"- keywords"
"- GC (in bash, make, C implementations)"
"- lots of other things")
(list
(title "why?")
"- because!")
(list
(title "why?")
"- because!"
"- gherkin was an inspiration to higher levels of crazy"
"- evolved into learning tool"
"- way to learn about Lisp and also the target language"
"- each implementation broken into small 10 steps")
(list
(title "thanks to:")
"- Peter Norvig: inspiration: lispy"
" - http://norvig.com/lispy.html"
"- Alan Dipert: gherkin, original gherkin slides"
" - https://github.com/alandipert/gherkin")
(list
(title "mal - Make a Lisp")
"https://github.com/kanaka/mal")
(list
(title "demo"))))
 
(def! present
(fn* (slides)
(if (> (count slides) 0)
(do
;;(py!* "import os; r = os.system('clear')")
;;(sh* "clear")
;;(make* "$(shell clear)")
(println (clear))
 
;;(prn (first slides))
(apply println (map (fn* (line) (str "\n " line)) (first slides)))
(println "\n\n\n")
(readline "")
(present (rest slides))))))
 
(present conj-slides)