Boost logo

Boost Users :

Subject: Re: [Boost-users] [phoenix][lambda] lambda to phoenix translation: get sig (signature) from actor
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-05-30 17:36:53


On 5/30/10 11:26 AM, alfC wrote:
>> I am not sure if this is the best way to do it in either Lambda nor
>> Phoenix (I'm pretty sure that even with lambda, you are going beyond
>> the documentation, no?).
>
> I guess that extracting subexpressions (and subexpression types) of an
> expression goes beyond Lambda and Phoenix documentation.
> and yes that is what I am trying to do.
>
>> However, I am not knowledgeable enough of the
>> domain you are involved with, nor do I know what qawc means.
>
> qawc is an interface to http://tinyurl.com/gslqwac
> now you can imagine what I a trying to do, basically extract the
> function information from a lambda expression.
>
>> In Phoenix (see Actors In Detail at:http://tinyurl.com/24wlduz),
>> a lambda is always an:
>>
>> actor<Eval>
>> The documented "result" protocol for Eval is:
>>
>> T::result<Env>::type
>>
>> where Env is your environment (See the link I provided above). Typically,
>> for client use, the environment is just basic_environment<...>.
>
> well I tried this and didn't work
> typename
> actor<LambdaExp>::result<basic_environment<quantity<UnitIntegrandDomain>
>>> ::type
>
> now my closest guess is
> typename actor<LambdaExp>::template
> result<actor<LambdaExp>(quantity<UnitIntegrandDomain>)>::type
>
> which is almost the type I am trying to generate but it is of
> 'const&' (const reference) type which is a problem for a return type
> because
> of 'returning reference to temporary'.

Perhaps just remove ref if you want the value?

Anyway, I think I need to look more closely. But right now,
I'm quite full. It seems you have it working anyway, no? If so,
can we get back to this later so I can offer a better library
solution? I'm very interested with this and how we can do better
with the current Phoenix-3 rewrite.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net