Add panic
This commit is contained in:
parent
0f2e30a8de
commit
1d9559402c
|
@ -147,7 +147,7 @@
|
||||||
(def panic {
|
(def panic {
|
||||||
:name "panic"
|
:name "panic"
|
||||||
::ast/type ::ast/clj
|
::ast/type ::ast/clj
|
||||||
:body (fn [msg & _] (throw (ex-info msg {})))
|
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))
|
||||||
})
|
})
|
||||||
|
|
||||||
(def prelude {"eq" eq "add" add "panic" panic})
|
(def prelude {"eq" eq "add" add "panic" panic})
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
(do
|
(do
|
||||||
|
|
||||||
(def source "
|
(def source "
|
||||||
add (1, 2, 3)
|
if true then :yay else panic (\"whoops\")
|
||||||
|
|
||||||
")
|
")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user