Skip to content

Commit

Permalink
CLJS-366: revert CLJS-39, broke :when and change no longer necessary …
Browse files Browse the repository at this point in the history
…now that we track let expressions in loops.
  • Loading branch information
David Nolen authored and David Nolen committed Aug 31, 2012
1 parent 1fd703f commit b73c51a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/clj/cljs/core.clj
Expand Up @@ -944,7 +944,7 @@
v (second exprs)

seqsym (when-not (keyword? k) (gensym))
recform (if (keyword? k) recform `(recur (first ~seqsym) ~seqsym))
recform (if (keyword? k) recform `(recur (next ~seqsym)))
steppair (step recform (nnext exprs))
needrec (steppair 0)
subform (steppair 1)]
Expand All @@ -958,12 +958,11 @@
~subform
~@(when needrec [recform]))
~recform)]
:else [true `(let [~seqsym (seq ~v)]
:else [true `(loop [~seqsym (seq ~v)]
(when ~seqsym
(loop [~k (first ~seqsym) ~seqsym ~seqsym]
~subform
(when-let [~seqsym (next ~seqsym)]
~@(when needrec [recform])))))]))))]
(let [~k (first ~seqsym)]
~subform
~@(when needrec [recform]))))]))))]
(nth (step nil (seq seq-exprs)) 1)))

(defmacro array [& rest]
Expand Down

0 comments on commit b73c51a

Please sign in to comment.