The F# language does partial application through calling the function: if you 
don't supply enough 
arguments, they're partially applied.  The |> syntax is for "backwards" 
(object-y)  partial application:

let f x y = ...
let g = f 1
let h = 1 |> f

The |> operator is built-in in F#, but in OCaml (my background), |> can be 
defined easily enough:
let (|>) x f = f x

~~ Robert Fischer, Smokejumper IT Consulting.
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/gormbook


B Smith-Mannschott wrote:
> On Sun, Oct 18, 2009 at 20:04, Stuart Halloway
> <stuart.hallo...@gmail.com> wrote:
>> I find the suite of ->, ->>, anonymous functions, partial, and comp
>> sufficient for my needs, with each having its place.
>>
>> My only grumble is that "partial" is a lot of characters. I would love
>> a one-character alternative, if it could be reasonably intuitive.
>>
> 
> F# uses >> for functional composition and |> for partial evaluation.
> Both as infix operators, of course. Perhaps they'd work for clojure's
> prefix syntax?
> 
> (def >> comp)
> (def |> partial)
> 
> what do you think?
> 
>> Stu
>>
>>> On Oct 16, 10:22 pm, Sean Devlin <francoisdev...@gmail.com> wrote:
>>>> In order to generate closures, every function should take parameters
>>>> first, and data at the end, so that they work well with partial.
>>> It's really hard to come up with a consistent practice that works well
>>> for all scenarios.  Even clojure.core is inconsistent in this regard
>>> -- the sequence fns take the seq at the end, the collection functions
>>> (like assoc) take the collection first.
>>>
>>> Whichever way you design your functions, half the time the arguments
>>> will be in the wrong place for what someone wants to do.  If you want
>>> a purely compositional style, the only way to do it is to only allow
>>> single-argument functions, a la Haskell.
>>>
>>> -SS
>>
> 
> > 
> 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to