Boost logo

Proto :

Subject: Re: [proto] using phoenix in MSM
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-05-09 18:03:22


On Monday, May 09, 2011 11:18:50 PM Christophe Henry wrote:
> Hi,
>
> Thanks to Eric's latest changes (which removed conflicts between MSM
> and phoenix), and Thomas' help, I added the possibility to use phoenix
> as an action inside eUML.
> There is still quite a bit to be done to be able to do with phoenix
> the same stuff as with standard eUML, but for the moment I can:
> - define a guard or action with a phoenix actor
> - provide a guard with eUML and an action with phoenix and vice-versa
> - use my own placeholders instead of arg1.. (_event, _fsm, ...)
>
> I have all in a branch
> (https://svn.boost.org/svn/boost/branches/msm/msm_phoenix) with a
> simple example.

Small remark:
Global objects seem to get out of fashion: They have a negative impact on
compile times and binary size.
instead of using phoenix::function on global (namespace) scope, you could use
the newly introduced macros to define equivalent free functions.
For example, instead of this:

    boost::phoenix::function<process_play_impl> process_play;

you could just have:
   
    BOOST_PHOENIX_ADAPT_CALLABLE(process_play, process_play_impl, 1)

For documentation see:
https://svn.boost.org/svn/boost/trunk/libs/phoenix/doc/html/phoenix/modules/function/adapting_functions.html

> It's not a huge amount but usable. As I only allow phoenix with a
> define (for security), I now have 2 possibilities:
> - keep working in the branch and release with 1.48
> - release with 1.47. There is no risk of breaking anything as we have
> the #define so it's safe.
>
> I'm very tempted to release with 1.47 so that Michael or whoever is
> interested would have a chance to try it out and tell me what he'd
> like to see there first, without having to get a branch. Plus it would
> be one more use case of phoenix.
> Preconditions:
> - phoenix is really out at 1.47

It is merged to release. So there is nothing that holds it back now ;)

> - I have a small worry with expression::argument<?>. The doc indicates
> it starts at index 0, but when I try, it starts at 1. Is the doc not
> up-to-date, the code, or I'm plain wrong?

The docs are wrong, thanks for pointing it out. Consider it fixed.

> Is there some interest to see MSM support phoenix, even only partly, in 1.47?


Proto list run by eric at boostpro.com