From 01e7345d815b1f7296504429c2b5b50fabd118d1 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Wed, 25 Nov 2020 18:38:15 +0000 Subject: Revert "feature(core): print empty vectors as [] in the REPL" This reverts commit 7b02ecaff4e3e884700e4ec6a0ab4db28966dca1 --- cljlib.fnl | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'cljlib.fnl') diff --git a/cljlib.fnl b/cljlib.fnl index 814b3af..e7b5f31 100644 --- a/cljlib.fnl +++ b/cljlib.fnl @@ -376,14 +376,7 @@ Sets additional metadata for function [`vector?`](#vector?) to work. (assert (eq v [1 2 3 4])) ```" [& args] - (setmetatable args {:cljlib/type :seq - :__fennelview (fn [t] - (let [res [] - view (require :fennelview)] - (each [_ v (ipairs t)] - (insert res (view v))) - (.. "[" (table.concat res " ") "]"))) - :__name "vector"})) + (setmetatable args {:cljlib/type :seq})) (fn* core.seq "Create sequential table. @@ -1105,9 +1098,12 @@ that would apply to that value, or `nil` if none apply and no default." "Returns stateless `ipairs` iterator for ordered sets." (fn [] (fn set-next [t i] - (each [k v (pairs t)] - (if (= v (+ 1 i)) - (lua "return v, k")))) + (fn loop [t k] + (local (k v) (next t k)) + (if v (if (= v (+ 1 i)) + (values v k) + (loop t k)))) + (loop t)) (values set-next Set 0))) (fn hash-set-ipairs [Set] -- cgit v1.2.3