-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 thx *note: use macroexpand next time*
Am 02.11.2011 10:58, schrieb Jonas: > > > On Wednesday, November 2, 2011 11:37:32 AM UTC+2, HamsterofDeath > wrote: > > hi there, > > i stumbled over two odd things 1) -> and ->> have the same source > code. why is that? > > Similar, but not the same [1]: (~(firstform)~x~@(nextform)) vs. > (~(firstform)~@(nextform)~x) > > > 2) why can't i use "(-> "hi" #(println %))" directly? why do i have > to put my function into a symbol first? is there a way to avoid > this? > > #(println %) expands to (fn [%] (println %)) so (-> "hi" #(println > %)) expands to (fn "hi" [%] (println %)). > > Note also that (-> "hi" println) would work since it's transformed > into (println "hi"). Also, the form (-> "hi" (#(println %))) should > also work fine. > > /jonas > > [1] > https://github.com/clojure/clojure/blob/f5f827ac9fbb87e770d25007472504403ed3d7a6/src/clj/clojure/core.clj#L1528 > > > > -- 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 - -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJOsRfHAAoJENRtux+h35aGaUwQAI5Uj2j1NYaNn6UotXvkJq9f JlK34bLhcNu0moWb1lK7m+OQI98OmXtpdjSU1Flc14MECphQ3mst2HkP5fkh1JxE P1RDUcLwD/pPTy1opZ7JAIi8YygBD8hSGxMYIwMLDv+YZdo6aZoDHSIFlJBcrFla EFlDZRg7pgRcRUdCL35VUALr4AGuQ7eqtbsfaB2PXyfC6b8qW2JvICukokZofqyQ ceO37GCc7CjpcMviAEABa+ByDSEwouiawDYkiDDdNTs9ZmsRX6PQUB9w75NQ5C5h 5mTIR/5KsMDqcGO2pNWGUOdA/d5Oj30EkUPd4pwNHwT4mgWjZbZk1aLX/CrfbRyT KPwenuXrelFsWC7uk0xBwLJwc8Z/85CXsVYATBWItS+05yD+i41GYD4ejnpjBgUw BiMms+T/A8vorbAjelgVs6Y53PJxndT+7wVL0Osj7HNaj/CItgMoos/yce/rOeig jGvHo943A8OAxzAtf3LsLvHBf8xUO6eupSCVDJl891jRMdUEfLezRL2aisjXtWj5 ZXkb1rEGJHS11xm5fNBQF35JmFmNwD78zepJKqVgQjaMDVb79sSIQfmI9308F7Iy TEanIVTCn1ZnoxZiTTy5fbFXuufMvWzrEywVdJ0os9Os8hufGBAatFikArl5OuOD KKKLbIeI8QvLJuOAwZwE =nyKh -----END PGP SIGNATURE----- -- 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