-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
sort
and sort-by
on a map return the map keys rather than sorted sequences.
to reproduce
- Open up a REPL and try to sort a map with some entries
basilisp.user=> (sort {:2 1 :1 3 :3 2})
;; => (:1 :2 :3)
- The values returned are the sorted keys rather than a two pair sequences representing the key value pairs.
The same on Clojure returns
user> (sort {:2 1 :1 3 :3 2})
;; => ([:1 3] [:2 1] [:3 2])
sort-by
throws an error instead:
basilisp.user=> (sort-by first {:2 1 :1 3 :3 2})
...
File "C:\src\basilisp\src\basilisp\lang\seq.py", line 255, in sequence
i = iter(s)
^^^^^^^
TypeError: 'Keyword' object is not iterable
while on clojure
user> (sort-by first {:2 1 :1 3 :3 2})
;; => ([:1 3] [:2 1] [:3 2])
Exploratory PR to follow.
chrisrink10
Metadata
Metadata
Assignees
Labels
No labels