On further reflection, perhaps the best approach would use sorted-map:

(defstruct example :msg :order)

(def a (struct "there" 2))
(def b (struct "hi" 1))
(def c (struct "everyone" 3))

We want our map to be sorted on the :order key. So:

(sorted-map (:order a) a (:order b) b (:order c) c)

I could wrap up some of this behavior into some functions that would
clean it up.  Is this the best approach, or should I be approaching
this from another direction?
--~--~---------~--~----~------------~-------~--~----~
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