diff options
| -rw-r--r-- | repl.neb | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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)))))) |
