jfabry / LiveRobotProgramming

Live Robot Programming
http://pleiad.cl/lrp
8 stars 3 forks source link

same functions inside several events should be executed once #141

Open mcamp opened 7 years ago

mcamp commented 7 years ago

If we have this machine

(machine m (state foo) (state bar) (state baz) (on event1 foo -> bar) (on event2 foo -> baz) (event event1 [robot heavyFunction. "do something"]) (event event2 [robot heavyFunction. "do something else"]) )

In this case, the function robot>>heavyFunction would be nice to be executed only once. We can do that by adding a new state after foo that computes the function on a running action.

Im putting this issue to remember us to think about this use case and see what it is the best solution