Re: Question about map destrustures
Isn't it just: (defn a [m] (println m)) If you want access to the keys: (defn a [{:keys [k j] :as m}] (println k)) Kris On Monday, 24 February 2014 14:34:13 UTC, bob wrote: > > Hi, > > There is a function a > > (defn a > [ & {:as m}] > (println m)) > > it accepts pair of params , for example (a :k 1 :j 2), however now I have > a map {:k 1 :j 2}, the question is how to convert the map to be accepted by > a? > > Thanks > -- 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: Question about map destrustures
Hi, There's no core function for this (would probably be called mapply). Try calling (apply concat m) on your map, then passing with (apply a (apply concat m)). Thanks, Ambrose On Mon, Feb 24, 2014 at 10:34 PM, bob wrote: > Hi, > > There is a function a > > (defn a > [ & {:as m}] > (println m)) > > it accepts pair of params , for example (a :k 1 :j 2), however now I have > a map {:k 1 :j 2}, the question is how to convert the map to be accepted by > a? > > Thanks > > -- > 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: Question about map destrustures
Works, Thanks. On Monday, February 24, 2014 10:39:12 PM UTC+8, Ambrose Bonnaire-Sergeant wrote: > > Hi, > > There's no core function for this (would probably be called mapply). > > Try calling (apply concat m) on your map, then passing with (apply a > (apply concat m)). > > Thanks, > Ambrose > > > On Mon, Feb 24, 2014 at 10:34 PM, bob >wrote: > >> Hi, >> >> There is a function a >> >> (defn a >> [ & {:as m}] >> (println m)) >> >> it accepts pair of params , for example (a :k 1 :j 2), however now I have >> a map {:k 1 :j 2}, the question is how to convert the map to be accepted by >> a? >> >> Thanks >> >> -- >> 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.