Re: [boost] FC++: formal review
by Brian McNamara other posts by this author
Feb 28 2004 8:45PM messages near this date
[boost] Re: FC++: formal review
|
Re: [boost] FC++: formal review
Thanks much for submitting a formal review and for your comments. You
clearly spent a bit of time reviewing the library and I appreciate it.
A few quick remarks to address a few of your questions...
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).
> Implementation
> -------------------------------------------------------------------------
> 1. BOOST_FCPP_DEFER_DEFINITIONS
> This does not look like a good solution. What exactly did you try to
> achieve?
> 2. definition.cpp
> What is this? Does it gets compiled by any compiler?
Joel de Guzman showed me an elegant solution which gets rid of the need
for either of these, so they will disappear.
> 5 What is konst vs. const?
I think section 10.7 of the docs explains what they do:
const_ // Turns a value into a thunk
// Ex: const_(3) yields a new function "f": f()=3
konst // Turns a value into a constant unary function
// Ex: konst(3) yields a new function "f": f(anything)=3
--
-Brian McNamara (lorgon@cc.gatech.edu)
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Gennadiy Rozental
Peter Dimov
Matthew Vogt
Brian McNamara
Gregory Colvin
David Abrahams
Joel de Guzman
Gennadiy Rozental
Brian McNamara
Joel de Guzman
|