From 82f5622dd6babf8d3984b694a3267aa3eae92d12 Mon Sep 17 00:00:00 2001 From: mryouse Date: Fri, 29 Jul 2022 19:08:15 +0000 Subject: WIP repl still doesn't really work --- repl.neb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repl.neb b/repl.neb index 4ec2401..41dacb6 100644 --- a/repl.neb +++ b/repl.neb @@ -34,6 +34,7 @@ tmp) (func print-result (res) + ;(def calc res) (print (concat "=> " (if (eq? :string (typeof res)) (raw res) @@ -45,15 +46,20 @@ (def panicked #false) ; we may not need this two-step if there's a :panic type (def evaluated (try - (eval (parse-neb this-cmd)) + ;(eval (first (parse-neb this-cmd))) + (quote (first (parse-neb this-cmd))) + ;(quote (map eval (parse-neb this-cmd))) + ;(parse-neb this-cmd) (block (redef panicked #true) _panic_))) + ;(print evaluated) + (if panicked (print (concat "panic! " evaluated)) (block - (print-result evaluated) + (print-result 'evaluated) (redef next-cmd-num (+ 1 next-cmd-num)) (redef _history_ (append _history_ this-cmd)))))) -- cgit v1.2.3