[msm] eUML guard/action location

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 (something like adjacent_find_(...) ) and I was having difficulties keeping the rows readable. Concretely, I often had to keep the target state on a line by itself, which was costing a line of my screen. With the current syntax, you can get it easier: CurrentState() + cool_event() = DestState() [VeeeeeryLoooooooooongGuard()] /(LooooooooooooooooongAction()) instead of: CurrentState() + cool_event() [VeeeeeryLoooooooooongGuard()] /(LooooooooooooooooongAction()) = DestState() For the tranquility of my conscience, are you still sure you prefer the more logical syntax? Christophe

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 (something like adjacent_find_(...) ) and I was having difficulties keeping the rows readable. Concretely, I often had to keep the target state on a line by itself, which was costing a line of my screen. With the current syntax, you can get it easier:
CurrentState() + cool_event() = DestState() [VeeeeeryLoooooooooongGuard()] /(LooooooooooooooooongAction())
instead of:
CurrentState() + cool_event() [VeeeeeryLoooooooooongGuard()] /(LooooooooooooooooongAction()) = DestState()
For the tranquility of my conscience, are you still sure you prefer the more logical syntax?
Christophe _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Christophe - 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() That would keep the alignment looking the same. I think you raise a very important consideration for something like eUML. Not only should the syntax make sense but the code when written should provide some representation of the intent. Does that look any better or worse than this? CurrentState() + cool_event() = DestState() [VeeeeeryLoooooooooongGuard()] /(LooooooooooooooooongAction()) Not in my opinion. I can imagine trying to teach a session on MSM and using eUML. I think the more logical syntax will be more quickly adopted. Just my thoughts. Thanks for asking. michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com

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@sig.com Software Engineer, Core Software using std::disclaimer; Susquehanna International Group, LLP http://www.sig.com 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.

On Tue, Dec 8, 2009 at 11:57 AM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
Michael Caisse wrote:
Christophe Henry wrote:
[snip]
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.
How about: CurrentState() + cool_event()[guard()]/(action()) -> DestState() Might not be as easy because of operator precedence. But it can be made to work with proto without much problems. [snip] -- Felipe Magno de Almeida

Stewart, Robert wrote:
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 - I actually like this quite a bit. 1. it keeps the event/guard/action with the source state 2. the '=' read funny to me in the other. Here it actually reads "properly". RHS is evaluated and becomes LHS. Nice suggestion. michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com

+1 (sorry for top posting...) ________________________________________ From: boost-bounces@lists.boost.org [boost-bounces@lists.boost.org] On Behalf Of Michael Caisse [boost@objectmodelingdesigns.com] Sent: Tuesday, December 08, 2009 5:40 PM To: boost@lists.boost.org Subject: Re: [boost] [msm] eUML guard/action location Stewart, Robert wrote:
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 - I actually like this quite a bit. 1. it keeps the event/guard/action with the source state 2. the '=' read funny to me in the other. Here it actually reads "properly". RHS is evaluated and becomes LHS. Nice suggestion. michael -- ---------------------------------- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Stewart, Robert writes:
Here's another suggestion, though it breaks from the logical UML ordering Michael posted previously:
DestState() = CurrentState() + cool_event()[guard()]/(action())
Here's another +1 for this. Not having a strong background with UML, but preferring eUML to the standard frontend, I find this arrangement much more logical.

On Dec 9, 2009, at 8:22 AM, Adam Merz wrote:
Stewart, Robert writes:
Here's another suggestion, though it breaks from the logical UML ordering Michael posted previously:
DestState() = CurrentState() + cool_event()[guard()]/(action())
Here's another +1 for this. Not having a strong background with UML, but preferring eUML to the standard frontend, I find this arrangement much more logical.
Are all those parentheses used for optional arguments, or could we consider eliminating them? -- David Abrahams BoostPro Computing http://boostpro.com
participants (7)
-
Adam Merz
-
Christophe Henry
-
David Abrahams
-
Felipe Magno de Almeida
-
Michael Caisse
-
Stewart, Robert
-
Thomas Klimpel