Change interpreter (just change name of binding in interpret-repeat

This commit is contained in:
Scott Richmond 2023-12-24 14:12:50 -05:00
parent a6d64ff827
commit 7541d2499d

View File

@ -811,9 +811,9 @@
times (if (= :word (:type times-expr))
(resolve-word times-expr ctx)
(-> times-expr :data first))
block (second data)]
expr (second data)]
(if (not (number? times)) (throw (ex-info (str "Repeat needs a number, not a " (base/get-type times)) {})))
(dotimes [_ times] (interpret-ast block ctx))))
(dotimes [_ times] (interpret-ast expr ctx))))
(defn- interpret-literal [ast] (-> ast :data first))