Move prelude functions out to prelude ns
This commit is contained in:
parent
1d9559402c
commit
14b6e31081
36
src/ludus/prelude.clj
Normal file
36
src/ludus/prelude.clj
Normal file
|
@ -0,0 +1,36 @@
|
|||
(ns ludus.prelude
|
||||
(:require
|
||||
[ludus.ast :as ast]))
|
||||
|
||||
(def eq {
|
||||
:name "eq"
|
||||
::ast/type ::ast/clj
|
||||
:body =
|
||||
})
|
||||
|
||||
(def add {
|
||||
:name "add"
|
||||
::ast/type ::ast/clj
|
||||
:body +
|
||||
})
|
||||
|
||||
(def panic {
|
||||
:name "panic"
|
||||
::ast/type ::ast/clj
|
||||
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))
|
||||
})
|
||||
|
||||
(def print {
|
||||
:name "print"
|
||||
::ast/type ::ast/clj
|
||||
:body (fn [& args]
|
||||
(println (str args))
|
||||
:ok)
|
||||
})
|
||||
|
||||
(def prelude {
|
||||
"eq" eq
|
||||
"add" add
|
||||
"panic" panic
|
||||
"print" print
|
||||
})
|
Loading…
Reference in New Issue
Block a user