From 9226c0221e603668346676fffa8dc49e934882d3 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sun, 10 Jul 2022 21:13:41 +0000 Subject: strings should be printed with surrounding quotes --- repl.neb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repl.neb b/repl.neb index 77faed6..cc8ae06 100644 --- a/repl.neb +++ b/repl.neb @@ -33,6 +33,12 @@ (redef tmp (strip (read-line (prompt next-cmd-num))))) tmp) + (func print-result (res) + (print (concat "=> " + (if (eq? :string (typeof res)) + (concat "\"" res "\"") + (->string res))))) + ; this is the actual loop part (while #true (def this-cmd (get-non-empty-input)) @@ -43,10 +49,11 @@ (block (redef panicked #true) _panic_))) + (if panicked (print (concat "panic! " evaluated)) (block - (print (concat "=> " (->string evaluated))) + (print-result evaluated) (redef next-cmd-num (+ 1 next-cmd-num)) (redef _history_ (append _history_ this-cmd)))))) -- cgit v1.2.3