Add several functions to the prelude

This commit is contained in:
Scott Richmond 2022-03-20 19:35:29 -04:00
parent 3f8207fa41
commit 272951a411

View File

@ -10,7 +10,31 @@
::data/type ::data/clj
:body +})
(def panic {:name "panic"
(def sub {:name "sub"
::data/type ::data/clj
:body -})
(def mult {:name "mult"
::data/type ::data/clj
:body *})
(def div {:name "div"
::data/type ::data/clj
:body /})
(def inc {:name "inc"
::data/type ::data/clj
:body inc})
(def dec {:name "dec"
::data/type ::data/clj
:body dec})
(def ld-not {:name "not"
::data/type ::data/clj
:body not})
(def panic! {:name "panic!"
::data/type ::data/clj
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))})
@ -22,5 +46,11 @@
(def prelude {"eq" eq
"add" add
"panic" panic
"print" print})
"panic!" panic!
"print" print
"sub" sub
"mult" mult
"div" div
"inc" inc
"dec" dec
"not" not})