[CLJ-694] Set func create sorted hash-set Created: 18/Dec/10 Updated: 27/Dec/10 Resolved: 27/Dec/10
|Affects Version/s:||Release 1.2|
This code output is:
As you can see set function create hash-set, but already sorted.
|Comment by Fogus [ 27/Dec/10 8:15 AM ]|
The hash set that you're creating only seems sorted. That is, while the ordering of a set is not guaranteed, it's a perfectly valid set if it is. The ordering in this case is due to implementation details guided by the fact that you happen to be inserting values of the same type whose hash values are ordered. If you make a change to one of the values then you could see a change:
(set (list 1 3.0 2))
|Comment by Sergey Krauchenia [ 27/Dec/10 12:51 PM ]|
Thanks Michel for explanation.