-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 so -> and ->> behave the same as long as my functions only take one parameter?
Am 02.11.2011 10:58, schrieb Matt Hoyt: > First question answer: > > The code isn't the same. The ~x is the first argument for -> and > is the last argument for ->>. So if you do a long chain of > expression the first argument is passed into the return value into > the next function with -> and ->> pass that value as the last > parameter. > > Second question: > > I think what you mean is (->> "hi" println) . If you wanted to > give the function multiple arguments you could do this: > > (-> "hello" (println "world!")) and the other form it would be > (->> "world!" (println "Hello")) > > Matt Hoyt > ------------------------------------------------------------------------ > > *From:* Dennis Haupt <d.haup...@googlemail.com> > *To:* clojure@googlegroups.com *Sent:* Wednesday, November 2, 2011 > 4:37 AM *Subject:* -> vs ->> and names vs anonymous function > > hi there, > > i stumbled over two odd things 1) -> and ->> have the same source > code. why is that? 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? > > (let [dummy #(println %)] (->> "hi" dummy)) > > > > -- 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 <mailto: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 > <mailto: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 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/ iQIcBAEBAgAGBQJOsRekAAoJENRtux+h35aGrs4QAL1SWvdtktKl0rbTOXkdA9we rSJ1USxf+JAP7ckz6G2+U7P5q5SdyfsTMAjPU/tsSQDQeNx/8r15WhUZn2IXw8X0 9Gq8mSD7cF07u3Gsi51abVhxig1Gp8Npsk9f52mkfnw7UjTUbVrXEh01fC8L3KPL afI+HVLW2MIAgBKeTJF6W8w9xeDAJkrM+e2oQnpvMzOWBequ7UKihrPQ6//BMct3 dkqMLD/D4Hdhps9RQy9lXs9acHmdl2MSX2t2RDMzA9iqINBV6DJ6k2wTT2ZZ9R+d pxki6th8o3B6nEH1ti1ZDx3Sj+sx3L+FBLI1vriUOsFiq0GBzFj8SGYHz2impff9 90aVBA7lrSkHbiKugEEx2HMvgET6yG4pzvStApF8cb6hnGFf21V9kwEvV/F067Rd RafNSNu6DSHZyKV9oFeM0EnfsGYwo5Zg6EuxfZvYxCA2YFdWCWo6bqleqRjK2VF+ MblKmbhp215CYx82rgXDUpp5GTQZM8PWBO7aQWPbkiRT4BetQlKoB/scYSPzT9et PNaVHzZhQkdhSKRXFD+pNjFBgu3ATouoQDbQZWu3fl+HEZIQGFH8/+GYgEvxfXa8 Np4Ih2BD/NAoW6Pzj2Gsyd6FwGK4o21H9yykt9AC3HAoLOHJsa9AFH3e7QlwesJo uDmEpTYJ2KiFeGjsvIzL =G6Eu -----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