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
with can mean different things in different languages. In javascript,
it means the same thing as doto in clojure but in Python (and many
others I'm told) it means that the resource I used in the with block
should be automatically cleaned (the file should be closed, the
connexion should be freed, etc.) at the end of the block.
doto is not ambiguous
Beside, clojure itself uses the word with in many of its functions/macros.