On Sun, Oct 23, 2011 at 23:53, Sean Corfield <[email protected]> wrote: > On Sun, Oct 23, 2011 at 1:04 PM, Ben Smith-Mannschott > <[email protected]> wrote: >> On Sun, Oct 23, 2011 at 21:25, Meikel Brandmeyer <[email protected]> wrote: >>> The idiomatic solution is #(f % a1 a2 a3). I'm failing to see the issue >>> with “nice” and “expressive”, but that is most likely just me. >> I find myself reaching for partial when I could be using #() > > I was using #() and (fn..) extensively in my code until I noticed just > how many "anonymous" classes were being generated (we had a scenario > where we were repeatedly reloading the Clojure code - deliberately - > and of course ended up with thousands of these classes loaded!). > Understood it's fine in load-once-and-run scenarios. > > When I brought this up on IRC, several folks said they felt the comp / > partial approach was nicer because it was point-free - as well as not > generating new classes (new instances, yes, new classes, no - right?). > Since then, I've almost eliminated the use of #() and (fn..) in our > code and, whilst more verbose initially in some cases, I'm actually > really liking the point-free style and it's letting me see new > opportunities for refactoring and simplification that I hadn't seen > previously (often triggered by encouraging me to pay more attention to > argument ordering so that my functions are more composable). > > Given Meikel's 2009 blog post, I can understand why he might not > agree, but given that we have both -> and ->>, it does seem like we > have a 'hole' - comp/partial and ->> go together but there's no > comp/??? to go with -> and we have to resort to #(f % a1 a2 a3)...
I propose "partail" ;-) While partial fills up the arguments from the front, partail fills up the arguments from the back (the *tail*). Plus, the spellings are so similar that it would cause no end of confusion, particularly for people like me that swap letters every once in a while, even when we don't mean to. Ok, Cute name, but not a good name. Anyone got a better one? // Ben > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > World Singles, LLC. -- http://worldsingles.com/ > Railo Technologies, Inc. -- http://www.getrailo.com/ > > "Perfection is the enemy of the good." > -- Gustave Flaubert, French realist novelist (1821-1880) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
