Re: Order a sequence of maps with {:type :before [types]}

2011-05-09 Thread msappler
Hello Thanks for your answer. Yes it should throw an exception - there should be no cyclic orders. I want to use this for the initialisation functions of the game I am developing (http://resatori.com/cyber-dungeon-quest-alpha-1) There is a number of those functions and some need to come after so

Re: Order a sequence of maps with {:type :before [types]}

2011-05-08 Thread Ken Wesson
On Sun, May 8, 2011 at 10:56 PM, msappler wrote: > I want to order a sequence of maps with keys: > obligatory :type > optional :before [types]; which means the types should occur before > this element in the sequence. That's a quite complex and somewhat difficult problem. First of all, what if y

Order a sequence of maps with {:type :before [types]}

2011-05-08 Thread msappler
I want to order a sequence of maps with keys: obligatory :type optional :before [types]; which means the types should occur before this element in the sequence. I tried to use a custom java.util.Comparator but it only compares adjacent elements. This is my example: (defn- comes-after? "checks