ClojureScript

destructured locals in loops are closed over incorrectly

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

This is just like CLJS-22 except requires destructuring in the loop binding to trigger the error:

(loop [[_ i] [:dmy 0] j ()]
  (if (< i 5)
    (recur [:dmy (inc i)]
           (conj j (fn [] i)))
    (map #(%) j)))

ClojureScript incorrectly returns: (5 5 5 5 5)

Clojure correctly returns: (4 3 2 1 0)

Activity

Hide
David Nolen added a comment -

duplicate of CLJS-39

Show
David Nolen added a comment - duplicate of CLJS-39

People

  • Assignee:
    Unassigned
    Reporter:
    Chouser
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: