Boost logo

Boost :

Subject: Re: [boost] [msm] eUML guard/action location
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2009-12-08 09:58:08

Hi Michael, hi Robert, hi Felipe,

>CurrentState() + cool_event()
>/(LooooooooooooooooongAction()) = DestState()

I just wanted to bring an example from SimpleTimer (see doc):

Ringing() + tick() == Ringing() [ Source_<m_ringing_cpt>() -
Event_<m_tick>() > Int_<0>() ]
(Source_<m_ringing_cpt>() -= Event_<m_tick>() )

would become:

Ringing() + tick() [ Source_<m_ringing_cpt>() - Event_<m_tick>() > Int_<0>() ]
                          / (Source_<m_ringing_cpt>() -=
Event_<m_tick>() ) == Ringing()

Here, it is becoming hard to write action and target state on the same
line. And the action can be as big as one wishes.

>Here's another suggestion, though it breaks from the logical UML ordering Michael posted previously:
>DestState() = CurrentState() + cool_event()[guard()]/(action())

I like this one quite much! Not UML at all but pretty much C++-style.
And it'd become easy to write guard and action on the next lines if

>CurrentState() + cool_event()[guard()]/(action()) -> DestState()

It's very similar with Michael's syntax but I think the operator
precedence can be hard to master and we'll need extra parentheses.
I think there is no operator -> in proto but ->* .

We are making progress :)


Boost list run by bdawes at, gregod at, cpdaniel at, john at