
On Wed, Aug 24, 2011 at 6:52 PM, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
On 24/08/2011 18:43, Thomas Heller wrote:
Nice! I like the general idea of it! However, I am not really sure if adding stuff like this to phoenix::actor doesn't break stuff.
My suggestion would only affect evaluation of the 'call' proto node, not phoenix::actor.
Of course, in order to transform such a call node though, you need to implement the specific behaviour in the operator() overloads of phoenix::actor. I can see this happening though ... could be almost trivial ... we could add a post processing actions step to the evaluation which returns false_ if the expression shouldnt be evaluated just yet, or true_ otherwise. A function_eval node (which is, in a way equivalent to your imaginary call node) can then select the proper action based on which types it holds. For that we can reuse the logic Eric proposed.
As noted in one of my other posts, the problem is not really if the function is polymorphic or not. The problem is in variadic functions. I can't see a way to automically guess which overload the user wanted to call.
By polymorphic functions, I meant to say "functions with a template or overloaded operator()", which covers variadic functions.
But that clarifies the problem indeed, the problem is in variable arity.