Boost logo

Boost :

Subject: Re: [boost] [msm] eUML guard/action location
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-12-08 08:57:52

Michael Caisse wrote:
> Christophe Henry wrote:
> > Hi Michael,
> >
> > I just remembered the last reason for the current eUML syntax:
> > CurrentState() + cool_event() = DestState() [Guard()]/(action())
> >
> > It is that eUML row actions/guards can become quite long...
> >
> > CurrentState() + cool_event() = DestState()
> > [VeeeeeryLoooooooooongGuard()]
> > /(LooooooooooooooooongAction())
> >
> > instead of:
> >
> > CurrentState() + cool_event()
> > [VeeeeeryLoooooooooongGuard()]
> > /(LooooooooooooooooongAction())
> > = DestState()

Both are less than ideal, but as formatted, the former is more readable.

> Ah... very good point. I've been doing a lot of Spirit/Qi work
> this past year and I can tell you the source code formatting makes all
> the difference in the world.
> I would likely just use copious white space:
> CurrentState() + cool_event()
> [VeeeeeryLoooooooooongGuard()]
> /(LooooooooooooooooongAction()) = DestState()
> Does that look any better or worse than this?
> CurrentState() + cool_event() = DestState()
> [VeeeeeryLoooooooooongGuard()]
> /(LooooooooooooooooongAction())

With whitespace, I agree that there's little difference between the two.

Here's another suggestion, though it breaks from the logical UML ordering Michael posted previously:

   DestState() = CurrentState() + cool_event()[guard()]/(action())

This is in keeping with Spirit's syntax in that the guard/action expression is positioned like a semantic action. It also reads better in C++ because we think in terms of evaluating the RHS and assigning the result to the LHS, and the RHS results in the state on the LHS in the above syntax.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

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