Interpret panic! not as fn but as rw.
This commit is contained in:
parent
4aeaa9e889
commit
9dd963e5b2
|
@ -308,6 +308,9 @@
|
|||
))
|
||||
)
|
||||
|
||||
(defn- panic [ast ctx]
|
||||
(throw (ex-info (show/show (interpret-ast (:expr ast) ctx)) {:ast ast})))
|
||||
|
||||
(defn interpret-ast [ast ctx]
|
||||
(case (::ast/type ast)
|
||||
|
||||
|
@ -337,6 +340,8 @@
|
|||
|
||||
::ast/ref (interpret-ref ast ctx)
|
||||
|
||||
::ast/panic (panic ast ctx)
|
||||
|
||||
::ast/recur
|
||||
{::data/recur true :tuple (interpret-ast (:tuple ast) ctx)}
|
||||
|
||||
|
@ -406,8 +411,10 @@
|
|||
|
||||
(def source "
|
||||
|
||||
let :foo = :bar
|
||||
print (:foo)
|
||||
print (:bar)
|
||||
|
||||
panic! \"well, shit\"
|
||||
|
||||
|
||||
")
|
||||
|
|
Loading…
Reference in New Issue
Block a user