ClojureScript

Compilation of unordered collections

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Given:

(defn f [x] (println x) x)

{(f 5) (f 10), (f :x) (f :y)}

Clojure produces:

5
10
:x
:y

{5 10, :x :y}

ClojureScript produces:

5
:x
10
:y

{5 10, :x :y}

Activity

Hide
David Nolen added a comment -

Is this actually a problem?

Show
David Nolen added a comment - Is this actually a problem?
Hide
Brandon Bloom added a comment -

See also: CLJ-1043

I realized that this problem is actually only partially solvable as is. We could assign the interleaved keys and values to locals before constructing the map. Unfortunately, that doesn't solve a bigger underlying problem: The reader returns unordered sets and maps.

Show
Brandon Bloom added a comment - See also: CLJ-1043 I realized that this problem is actually only partially solvable as is. We could assign the interleaved keys and values to locals before constructing the map. Unfortunately, that doesn't solve a bigger underlying problem: The reader returns unordered sets and maps.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: