
On Fri, Sep 16, 2011 at 6:09 PM, David Sankel <camior@gmail.com> wrote:
[...] The reason I said that phoenix "somewhat" gets around the bind heritage problems, which was obscure I admit, was because phoenix's use of traditional bind syntax still leaves a semantic hole.
If someone writes the following:
template< typename F > auto doSomething( F f ) -> decltype(...) { return bind( f, 15, _1) }
And then I call doSomething elsewhere like this,
doSomething( bind( g, 12, _1, _2 ) )
, then the result is something most likely unexpected for the user who knows what doSomething means (it returns a version of f that has 15 filled in as its first argument (λx. λy. x(15,y))), but hasn't read its implementation.
Boost.Lambda has unlambda, which is documented to prevent exactly this problem: http://www.boost.org/doc/libs/1_47_0/doc/html/lambda/le_in_details.html#lamb... With a quick search I couldn't find the phoenix equivalent of unlambda, but I'm sure there must be. HTH, -- gpd