Boost logo

Boost Users :

Subject: Re: [Boost-users] [phoenix][lambda] lambda to phoenix translation: get sig (signature) from actor
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-05-31 04:18:53


> > Incidentally, your message is very timely. Joel and I have just been
> > discussing off-list the possibilities opened up by giving users access
> > to Phoenix expressions at this level. It's really very exciting.
>
> Indeed very timely. See also:http://tinyurl.com/37mguzo
> "phoenix domain language (to write mathematical formulas)"

right, since C++ is "mathematical enough" (or as mathematical as it
can be with the small set of available symbols [+,-,/,*,==]) then
phoenix is mathematical enough,
creating a mathematical DSEL on proto probably won't be better than
phoenix [except for very specific mathematical area, e.g. tensor
manipulation]

this discussion is very nice, and now that you know the context maybe
I can recast the question:

I am extracting a subexpression (don't know the exact name in phoenix
jargon)
called LambdaExp, by recognizing the pattern

actor<composite<
                divides_eval, vector<
                        LambdaExp, composite<
                        minus_eval, vector<
                                argument<0>,
                                boost::phoenix::value<
                                        quantity<UnitIntegrandDomain>
>
>
>
> > > f_expr

now I want to use this LambdaExp (extracted as at_c<0>(f_expr))
applied to a bind expression,
and subsecuently binded. ie in a composition of this kind, with the
functions 'value' and 'from_value'.

value( LambdaExp (from_value( x) ) )

(this in the context of boost.units is necesary to adimensionalize an
expression, apply a normal function and then restore de dimension),
this is the closest I got but doesn't work:

bind(
  &result_type::value,
  actor<LambdaExp>(at_c<0>(f_expr))( // Question: what goes here? to
apply the subexpr.
    bind(
        &quantity<UnitIntegrandDomain>::from_value,
        arg_names::arg1
    )
  ) // end here
);

Thank you,
Alfredo


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