Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sort-by bug in CLJS #40

Closed
den1k opened this issue Dec 29, 2020 · 4 comments
Closed

x/sort-by bug in CLJS #40

den1k opened this issue Dec 29, 2020 · 4 comments

Comments

@den1k
Copy link

den1k commented Dec 29, 2020

This only happens in CLJS

(= (sort-by identity > (shuffle (range 100)))
   (into [] (x/sort-by identity >) (shuffle (range 100))))

;; => false

Input is returned unchanged:

(into [] (x/sort-by identity >) [3 2 0 4 8 5 6 7 1 9])
;; => [3 2 0 4 8 5 6 7 1 9]
@den1k
Copy link
Author

den1k commented Dec 29, 2020

This works in CLJ and CLJS:

(into [] (x/sort-by identity (comparator >)) [3 2 0 4 8 5 6 7 1 9])
;; => [9 8 7 6 5 4 3 2 1 0]

@raspasov
Copy link

raspasov commented Aug 9, 2021

This seems to work in CLJS for me (running on JavaScript core, iOS):

(into [] (x/sort-by identity >) [3 2 0 4 8 5 6 7 1 9])

; => [0 1 2 3 4 5 6 7 8 9]

@den1k is this still an issue for you?

@den1k
Copy link
Author

den1k commented Aug 9, 2021

I don't have CLJS REPL handy right now but the environment was the browser. I'm not sure if anything changed in CLJS core or xforms to fix the bug

@den1k
Copy link
Author

den1k commented Aug 6, 2022

thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants