From 1d9559402c77ec76eea253e27e37bf34f54ba2ab Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sun, 20 Mar 2022 16:33:59 -0400 Subject: [PATCH] Add panic --- src/ludus/interpreter.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ludus/interpreter.clj b/src/ludus/interpreter.clj index c157fa3..b715564 100644 --- a/src/ludus/interpreter.clj +++ b/src/ludus/interpreter.clj @@ -147,7 +147,7 @@ (def panic { :name "panic" ::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}) @@ -255,7 +255,7 @@ (do (def source " - add (1, 2, 3) + if true then :yay else panic (\"whoops\") ")