summaryrefslogtreecommitdiff
path: root/cljlib.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'cljlib.fnl')
-rw-r--r--cljlib.fnl18
1 files changed, 7 insertions, 11 deletions
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]