Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pixie/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -2606,14 +2606,14 @@ Expands to calls to `extend-type`."
`(loop [res# []
~c (seq ~coll)]
(if ~c
(recur (into res#
~(gen-loop (into coll-bindings
[binding `(first ~c)])
(nnext bindings)))
(next ~c))
(let [~binding (first ~c)]
(recur (into res#
~(gen-loop (into coll-bindings
[binding `(first ~c)])
(nnext bindings)))
(next ~c)))
res#)))
`(let ~coll-bindings
[~@body])))]
`[~@body]))]
`(or (seq ~(gen-loop [] bindings)) '())))

(defmacro doto
Expand Down
6 changes: 5 additions & 1 deletion tests/pixie/tests/test-stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@
(t/assert= (for [x [1 2 3] y [:a :b :c]] [x y])
[[1 :a] [1 :b] [1 :c]
[2 :a] [2 :b] [2 :c]
[3 :a] [3 :b] [3 :c]]))
[3 :a] [3 :b] [3 :c]])
(t/assert= (for [x [[1 2 3]]
y x]
y)
[1 2 3]))

(t/deftest test-doto
(let [a (atom 0)]
Expand Down