thanks rasmus.. I was completely off on reasoning ..... Sunil. On Tue, Nov 9, 2010 at 6:58 PM, Rasmus Svensson <[email protected]> wrote:
> 2010/11/9 Carlos Moscoso <[email protected]>: > > user=> (-> {:a 1} (keyword "a")) > > -> is simply a code rewrite macro. You can use macroexpand-1 to see > how the rewrite is done: > > user=> (macroexpand-1 '(-> {:a 1} (keyword "a"))) > (keyword {:a 1} "a") > > As Sunil said, you can get the desired behaviour by adding parentheses: > > user=> (macroexpand-1 '(-> {:a 1} ((keyword "a")))) > ((keyword "a") {:a 1}) > > In this simple case, a simple get would be sufficient: > > user=> (get {:a 1} (keyword "a")) > 1 > > ...but I guess the code you posted was only the minimal case to > reproduce the error. > > Sometimes, get-in can also be an alternative to ->. > > // raek > > -- > 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]<clojure%[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 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
