
On Sat, Feb 28, 2004 at 02:53:23PM -0500, Gennadiy Rozental wrote:
I do not understand need for separate notion of thunks. Why couldn't we just bind all function arguments using usual means?
The "usual means" are either explicit currying or implicit currying. Given a 3-arg f:
f(x) or f(x,_,_) // result is binary func
just binds the first arg, and
f(x,y) or f(x,y,_) // result is unary func
just binds the first two, but clearly we can't say
f(x,y,z) // calls f
to bind all three, as this is the syntax to call the function now. As a result, the separate
thunk3(f,x,y,z) // result is nullary func
is used when you want to bind all N arguments and get back a nullary functor (a thunk).
IMO there should not be separate notion of thunk. We need built-in currying and external currying using bind facility. That's it. Gennadiy.