Mentions légales du service

Skip to content

Add the "switch" instruction

Created by: stephanemagnenat

This issue was moved from gna bug tracker, there it was bug 18102 (http://gna.org/bugs/?18102).

Florian Vaussard I agree, this is not a mandatory feature, but would be more confortable for big state machines.

Stéphane Magnenat Doing this is purely a syntactic extension, if implemented with chained if <-> else if.

The question whether it is worth the work and the complexification of the language, as chained elseif do implement the same idea:

if a == 1 then

elseif a == 2 then

elseif a == 3 then

else

end

Florian Vaussard It would be nice to have the "switch" instruction like in C.