filter on sets ... [reward: me face palming]
I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
without giving this much thought is the % actualy a vector like [:dh-uuid abc-def-ghi-klm] ? On Sat, May 25, 2013 at 2:21 PM, Mond Ray mondraym...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
can you tell what this returns? (map find-records query-parts) On Sat, May 25, 2013 at 2:21 PM, Mond Ray mondraym...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
(def some-list [{:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}]) If you want to filter out only nil: (filter (comp (complement nil?) :dh-uuid) some-list) If you want to filter out nil or false: (filter (comp identity :dh-uuid) some-list) -Steven On Saturday, May 25, 2013 6:21:22 AM UTC-5, Mond Ray wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
Why not just (filter (complement :dh-uuid) seq-of-maps)? Or (remove :dh-uuid seq-of-maps) even? On Sat, May 25, 2013 at 7:41 AM, sdegutis sbdegu...@gmail.com wrote: (def some-list [{:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}]) If you want to filter out only nil: (filter (comp (complement nil?) :dh-uuid) some-list) If you want to filter out nil or false: (filter (comp identity :dh-uuid) some-list) -Steven On Saturday, May 25, 2013 6:21:22 AM UTC-5, Mond Ray wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
Cedric's answer is best: either (filter :dh-uuid some-list) or (remove :dh-uuid some-list) depending on which list you want. On Sat, May 25, 2013 at 7:10 AM, Cedric Greevey cgree...@gmail.com wrote: Why not just (filter (complement :dh-uuid) seq-of-maps)? Or (remove :dh-uuid seq-of-maps) even? On Sat, May 25, 2013 at 7:41 AM, sdegutis sbdegu...@gmail.com wrote: (def some-list [{:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}]) If you want to filter out only nil: (filter (comp (complement nil?) :dh-uuid) some-list) If you want to filter out nil or false: (filter (comp identity :dh-uuid) some-list) -Steven On Saturday, May 25, 2013 6:21:22 AM UTC-5, Mond Ray wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/0TfUVMsfcD8/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondraym...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.finger...@gmail.comwrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondraym...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.comjavascript: wrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.comjavascript: wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) be better? On Sat, May 25, 2013 at 1:09 PM, Mond Ray mondraym...@gmail.com wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.comwrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/0TfUVMsfcD8/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
On the other hand ... does that mean that the sequence being filtered is not lazy? On Saturday, 25 May 2013 20:09:05 UTC+2, Mond Ray wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.comwrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
It's as I presented it - a list of a list of maps On Saturday, 25 May 2013 13:27:45 UTC+2, atkaaz wrote: can you tell what this returns? (map find-records query-parts) On Sat, May 25, 2013 at 2:21 PM, Mond Ray mondr...@gmail.comjavascript: wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
This is my latest working invocation: (doall (map #(remove :dh-uuid %) (map find-records query-parts))) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid nil})) The list of maps is retained which might be useful later. Thanks On Saturday, 25 May 2013 20:15:19 UTC+2, sdegutis wrote: Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) be better? On Sat, May 25, 2013 at 1:09 PM, Mond Ray mondr...@gmail.comjavascript: wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.comwrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/0TfUVMsfcD8/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: filter on sets ... [reward: me face palming]
= (doall (map #(remove :dh-uuid %) '(({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid *false*})) )) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid *false*})) idiomatic clojure ftw :) On Sat, May 25, 2013 at 9:38 PM, Mond Ray mondraym...@gmail.com wrote: This is my latest working invocation: (doall (map #(remove :dh-uuid %) (map find-records query-parts))) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid nil})) The list of maps is retained which might be useful later. Thanks On Saturday, 25 May 2013 20:15:19 UTC+2, sdegutis wrote: Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) be better? On Sat, May 25, 2013 at 1:09 PM, Mond Ray mondr...@gmail.com wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.comwrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group**/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/** topic/clojure/0TfUVMsfcD8/**unsubscribe?hl=enhttps://groups.google.com/d/topic/clojure/0TfUVMsfcD8/unsubscribe?hl=en . To unsubscribe from this group and all its topics, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- 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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at
Re: filter on sets ... [reward: me face palming]
Thanks for the demo ... the next part of my code will decide if the key is in an atom feed so I will be testing for false in the results too - FTW indeed :D On Saturday, 25 May 2013 21:01:31 UTC+2, atkaaz wrote: = (doall (map #(remove :dh-uuid %) '(({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid *false*})) )) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid *false*})) idiomatic clojure ftw :) On Sat, May 25, 2013 at 9:38 PM, Mond Ray mondr...@gmail.comjavascript: wrote: This is my latest working invocation: (doall (map #(remove :dh-uuid %) (map find-records query-parts))) (({:a2p-id 3, :dh-uuid nil}) ({:a2p-id 3, :dh-uuid nil})) The list of maps is retained which might be useful later. Thanks On Saturday, 25 May 2013 20:15:19 UTC+2, sdegutis wrote: Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) be better? On Sat, May 25, 2013 at 1:09 PM, Mond Ray mondr...@gmail.com wrote: Bingo: user= (filter (complement :dh-uuid) (apply concat (map find-records query-parts))) ({:a2p-id 3, :dh-uuid nil} {:a2p-id 3, :dh-uuid nil}) Thanks everyone! On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote: Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:27 AM, Andy Fingerhut andy.fi...@gmail.com wrote: If (map find-records query-parts) is returning this expression: (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner list. Andy On Sat, May 25, 2013 at 4:21 AM, Mond Ray mondr...@gmail.com wrote: I am missing something obvious... I get a list of maps back from a function and I want to find the elements with nil (({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil}) ({:a2p-id 1, :dh-uuid abc-def-ghi-klm} {:a2p-id 2, :dh-uuid def-ghi-klm-opq} {:a2p-id 3, :dh-uuid nil})) I try the select function but it has no effect ... same list (set/select #(not (:dh-uuid %)) (map find-records query-parts)) also tried the previously working example... same list (filter #(not (:dh-uuid %)) (map find-records query-parts)) I am assuming that I am not indexing into each of the maps but I cannot remember or find out how to do this ... all examples only show one map Thanks Ray -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group**/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/** topic/clojure/0TfUVMsfcD8/**unsubscribe?hl=enhttps://groups.google.com/d/topic/clojure/0TfUVMsfcD8/unsubscribe?hl=en . To unsubscribe from this group and all its topics, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email