Skip to content

Commit

Permalink
mal: implement DBGEVAL without assuming that a: is a valid symbol
Browse files Browse the repository at this point in the history
This does not seem worth a test, but can currently break the
self-hosting.
  • Loading branch information
asarhaddon committed Aug 27, 2024
1 parent 99f8b02 commit 182313e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion impls/mal/step2_eval.mal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

;; eval
(def! EVAL (fn* [ast env]
;; (do (prn 'EVAL: ast))
;; (do (prn "EVAL:" ast))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step3_env.mal
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step4_if_fn_do.mal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step6_file.mal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step7_quote.mal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step8_macros.mal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/step9_try.mal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down
2 changes: 1 addition & 1 deletion impls/mal/stepA_mal.mal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(def! EVAL (fn* [ast env]
(do
(if (env-get-or-nil env 'DEBUG-EVAL)
(prn 'EVAL: ast (env-as-map env)))
(println "EVAL:" (pr-str ast (env-as-map env))))
(try*
(cond
(symbol? ast)
Expand Down

0 comments on commit 182313e

Please sign in to comment.