Re: currying in clojure for fixed number of arg functions

2010-12-20 Thread ka
+1 on partial with no args ! I have a doubt: using partial conveys the intent, but with automatic currying one may get confused between "partial application" & "function call", no? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: currying in clojure for fixed number of arg functions

2010-12-19 Thread Robert McIntyre
What do people think about extending the definition of partial in core to work on just a single argument? That is, if you call partial with just a function and no arguments, it just returns the function. It seems to follow logically from the other airties. For a case where this is useful, see ht

Re: currying in clojure for fixed number of arg functions

2010-12-18 Thread Benny Tsai
This is very cool! Taken together with the following projects, Clojure now has some of the nicest parts of Haskell/ML, IMHO :) Matchure (pattern matching): http://spin.atomicobject.com/2010/04/25/matchure-serious-clojure-pattern-matching Algebraic Data Types: http://clojure.github.com/clojure-co

Re: currying in clojure for fixed number of arg functions

2010-12-18 Thread Eric Schulte
Ah, my apologies, Thanks for clarifying, I should have looked more closely at your code before responding. That is indeed a very nice idea (and an aspect of Haskell that I sorely miss in Clojure). I could see myself wanting to use this on a namespace level, e.g. have all functions defined in a n

Re: currying in clojure for fixed number of arg functions

2010-12-18 Thread Sunil S Nandihalli
very cool implementation .. Something tells me that you didn't leave your python background behind.. :) Sunil. On Sat, Dec 18, 2010 at 12:13 PM, Robert McIntyre wrote: > I think your work is a wonderful idea. I've been wanting to do this > myself for some time. > Thanks for actually doing it i

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Robert McIntyre
I think your work is a wonderful idea. I've been wanting to do this myself for some time. Thanks for actually doing it instead of just thinking about it. I have some humble thoughts/suggestions after reading your code; I'd love to hear what you think about these points: 1. I think that auto-curr

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Sunil S Nandihalli
On Sat, Dec 18, 2010 at 7:21 AM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hi Eric, > I do know about partial. But what I am saying is that the extra function, > partial, is not necessary if the function was created with > def-curry-fn... The function automatically returns a c

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Sunil S Nandihalli
Hi Eric, I do know about partial. But what I am saying is that the extra function, partial, is not necessary if the function was created with def-curry-fn... The function automatically returns a curried version when called with fewer number of arguments than necessary like it happens in ha

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Eric Schulte
Hi Sunil, This is already possible using `partial' function in clojure core, which also works for variable arity functions, e.g. (map (partial reduce +) [[1 2 3 4] [5 6 7 8]]) Best -- Eric Sunil S Nandihalli writes: > Hello everybody, > I remember that the key reasoning for not supporting cu