Hi Patrick, Please provide some code.
[email protected] a écrit : > I iterate through the list and for each row look up each of the > heading names in the Heading Info List to get an index of where a > particular element should be in the Actual Info List and then i go and > get this from the Actual Info List and use this as part of my key. > With the key i write the Row Number to the map. If the key is already > there i just cons it to the exiting map value. > Code smell: indexes. Most of the time, if you are using indexes there's something wrong in your code. To work with two parallel lists (heading-info-list and actual-info-list), you can either build a map (if your keys are distinct): (-> (zipmap heading-info-list actual-info-list) (select-keys headingnamelist) vals) or turn the pair of lists into a list of pairs before further processing: (map vector heading-info-list actual-info-list) or directly work in parallel on both lists: (map some-fn heading-info-list actual-info-list) hth, Christophe -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
