I think good arguments have been made for "doto," but I must say I prefer "with" slightly more.
FWIW, Groovy calls it "with." http://javajeff.blogspot.com/2008/11/getting-groovy-with-with.html The great thing about Clojure is that if this really bothered me I could easily take matters into my own hands. (defmacro with [x & forms] `(doto ~x ~...@forms)) Clojure rocks! On Mar 6, 7:36 pm, "Dimiter \"malkia\" Stanev" <mal...@gmail.com> wrote: > Thanks for the explanation guys! > > Having learned other languages, sometimes makes you wanna have the > MEMORY UNDO FEATURE! > > On Mar 6, 3:37 pm, Meikel Brandmeyer <m...@kotka.de> wrote: > > > > > Hi, > > > Am 07.03.2009 um 00:23 schrieb Laurent PETIT: > > > > I'm not sure about this, but I think doto is named after the > > > convention that a lot of side effecting functions/macros/special > > > forms follow : share the "do" prefix if the name implies that there > > > will be side effects. > > > > And indeed, if you use doto with more than one following expression, > > > then this list of expression will generate side effects (mutating > > > the target object, at a minimum). > > > I think "doto" is actually a good name. In contrast > > to ->, which uses the return value of the expressions > > doto always calls the given functions or methods > > using the initial thing. So it "does" the function > > calls "to" the thing. > > > Together with the points Laurent mentioned > > about the do-prefix indicating side-effects and > > the slightly different notion of the with-something > > blocks, I think doto is just good enough a name. > > > Just, my 2¢ and YMMV. > > > Sincerely > > Meikel > > > smime.p7s > > 5KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---