aseba icon indicating copy to clipboard operation
aseba copied to clipboard

Add an "else" branch to the "when" conditional

Open marvelous opened this issue 7 years ago • 1 comments

when toto == 1 do
    callsub start_moving
else/otherwise
    callsub stop_moving
end

It should only get executed when the condition goes from true to false. A workaround is to add an other when with a negated condition.

marvelous avatar Sep 14 '17 19:09 marvelous

It makes sense, and won't be too hard to implement. I suggest to use else to avoid adding a new keyword.

P.R. including proper unit tests welcome!

stephanemagnenat avatar Sep 15 '17 06:09 stephanemagnenat