On Mon, Nov 15, 2010 at 1:26 PM, Alan <a...@malloys.org> wrote: > I think comp is nice and short, personally. Partial is okay, and the > long name helps discourage me from using it when I should be using #() > instead - partial is a bit slower. And if you find yourself wanting to > nest #() forms, it's not that bad to switch to partial, and it may > serve as a warning sign that what you're doing should be multiple > expressions anyway.
Or at least using (fn [...] ...). Sometimes I use that over #() even under other circumstances, particularly if I feel it enhances readability a lot to name the thing's parameters. Even if they're [k v] rather than [farads ohms] that still communicates more than [%1 %2]. Another obvious use case for (fn [...] ...) is when you want to destructure one or more of the arguments. > The one that bugs me is complement - such a long name for a commonly- > useful function. I often wind up defining ! as an alias for > complement, but maybe others will think that is poor style. It fits the C family of languages, but doesn't fit the "names ending with ! mutate something and are called for their side effects" Clojure idiom. How about ~? Oh yeah, taken already for the syntax-unquote reader macro. I'd probably settle for some shorter English name, say (def flip complement). Another good choice might be "neg". Those lucky bastards in the far east can of course get away with 補充. :) -- 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