Boost logo

Boost :

Subject: Re: [boost] [local] Help for the Alternatives section
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-05-02 17:44:42


On 02/05/2011 23:33, lcaminiti wrote:

>> int BOOST_LOCAL_FUNCTION(int a1, bind int i)
>> {
>> return a1 + i;
>> }
>> BOOST_LOCAL_FUNCTION_NAME(foo);
>>
>
> You don't need to specify the bound variable type (that's automatically
> deduced using Boost.Typeof like Boost.ScopeExit does):

Ok, but that's still more verbose than the Phoenix version.

>> Simply put, the function cannot take its arguments as template
>> parameters, and also requires that the types of the arguments be
>> specified.
>>
>
> As I mentioned, Boost.Local does not require to specify the bound variable
> types

Note I said 'arguments'.

> [can bind variable without knowing their type]
> Question: Does this make Boost.Local local functions polymorphic

No.

> I also think this feature would be valuable. Do you have any specific use
> case in mind?

Parametric polymorphism is a very important property of functional
programming. System F, the theory behind the ML family of languages, is
polymorphic lambda calculus.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk