I reported this issue to the Clojure JIRA a while ago: http://dev.clojure.org/jira/browse/CLJ-1418 , please vote it up. El 29/09/2014 05:55, "Sunil S Nandihalli" <[email protected]> escribió:
> I think the definition of as-> should be changed to this. I feel this > behavior is more consistent with the rest of clojure. > > (defmacro as-> [expr name & forms] `(let [~name ~expr ~@(interleave > (repeat name) (take (dec (count forms)) forms))] ~(last forms)) > > Thanks, > Sunil > > On Mon, Sep 29, 2014 at 2:11 PM, Sunil S Nandihalli < > [email protected]> wrote: > >> Hi everybody, >> I get the following when I try to use the as-> macro >> >> >> user=> (def x (as-> {:a 10 :b 20} {:keys [a b] :as w} {:a (* 2 a) :b (* >> 2 b)})) >> #'user/x >> user=> x >> {:keys [20 40], :as {:a 20, :b 40}} >> user=> >> >> I would have expected x to be {:a 20 :b 40}, not what I see above. >> >> Can somebody explain? >> Thanks, >> Sunil. >> > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > 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 > --- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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 --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
