ClojureScript

Bug in sort

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Mac OS X, recently cloned ClojureScript repository
  • Patch:
    Code and Test

Description

The sort function (and thus sort-by) do not seem to be behaving as they would in normal Clojure. For example, in my ClojureScript REPL I have:

ClojureScript:cljs.user> (def values (list [-11 10] [-8 12] [-15 -4] [4 5]))
([-11 10] [-8 12] [-15 -4] [4 5])
ClojureScript:cljs.user> (sort values)
([-11 10] [-15 -4] [-8 12] [4 5])

But in the Clojure REPL, you get what one would expect:
user=> (def values (list [-11 10] [-8 12] [-15 -4] [4 5]))
#'setback.core/values
user=> (sort values)
([-15 -4] [-11 10] [-8 12] [4 5])

I have only noticed this bug for sorting vectors, since in Clojure vectors are sorted position by position.

Activity

Hubert Iwaniuk made changes -
Field Original Value New Value
Assignee Hubert Iwaniuk [ neotyk ]
Hubert Iwaniuk made changes -
Attachment CLJS-204-IComparable.patch [ 11219 ]
Hubert Iwaniuk made changes -
Patch Code and Test [ 10002 ]
Hubert Iwaniuk made changes -
Attachment CLJS-204-IComparable.patch [ 11219 ]
Hubert Iwaniuk made changes -
Attachment CLJS-180-IComparable-squashed.patch [ 11220 ]
Hubert Iwaniuk made changes -
Attachment CLJS-204-IComparable.patch [ 11227 ]
Hubert Iwaniuk made changes -
Attachment CLJS-180-IComparable-squashed.patch [ 11220 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: