I want to create a sorted-set of structmaps that are sorted on a
particular key of the structmap.  The set was going to act as a queue,
and initially I implemented this using a PriorityQueue with a
Comparator I made using proxy. In general, I'd prefer to use pure
Clojure, and sorted-set seemed like the right approach, but it seems
that elements in sorted set must implement Comparable, since there
doesn't seem to be a way to specify a Comparator as there is with a
sorted-map (using sorted-map-by).  I couldn't find a sorted-set-by.

One idea I had was to attempt to create a subclass (using proxy) of
PersistentStructMap that implemented Comparable and use those as my
elements of the sorted set, but that seems too OO for my needs, and it
was looking kind of ugly as I started to try and write it.

I'm hoping there is some obvious idiom I'm missing here.  Can anyone
enlighten me, or should I be writing my own sorted-set-by function?

Thanks,
Rick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to