diff options
| author | Andrey Orst <andreyorst@gmail.com> | 2020-11-25 18:38:15 +0000 |
|---|---|---|
| committer | Andrey Orst <andreyorst@gmail.com> | 2020-11-25 18:38:15 +0000 |
| commit | 01e7345d815b1f7296504429c2b5b50fabd118d1 (patch) | |
| tree | 39e2bc2f220991729ccc3a75318d51c9d095a2ee /cljlib.fnl | |
| parent | 7b02ecaff4e3e884700e4ec6a0ab4db28966dca1 (diff) | |
Revert "feature(core): print empty vectors as [] in the REPL"
This reverts commit 7b02ecaff4e3e884700e4ec6a0ab4db28966dca1
Diffstat (limited to 'cljlib.fnl')
| -rw-r--r-- | cljlib.fnl | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -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] |