Closed jasonkuhrt closed 10 years ago
If it is a bug this issue belongs somewhere else, maybe light-table.
@jasonkuhrt this is not a bug. Sets do not have an order.
@swannodette How does first
decide which element to take then?
I am able to produce what I would expect in another file:
(first #{:a :b :c}) ;; :a
(rest #{:a :b :c}) ;; (:c :b)
Are you saying this should be considered correct?:
(rest #{:a :b :c}) ;; (:a :c)
If so it seems to make rest
etc pretty useless for sets
?
I am still confused by these results.
My additions using the :a :b :c
return what I expect. What's going on here?
My guess is that sets are sorted by a hash value for its elements. Hash values are somewhat random by design, so that would explain the seemingly random ordering of the sets when they are coerced to a sequence.
I saw this today which looks wrong.
Specifically, this part:
Am I missing something or is this a bug?