3 ms·
I don't know when it was added, but Ada does have a switch/case equivalent construct and I can't imagine it wasn't available early on. case X is when 1 =
by Jtsummers 6y ago
I don't know when it was added, but Ada does have a switch/case equivalent construct and I can't imagine it wasn't available early on.
case X is
when 1 => ...;
when 2 => ...;
when 3 | 4 | 100 => ...
when others => ...
end case;
- okl 6y agoIt was always part of the language, http://archive.adaic.com/standards/83lrm/html/lrm-05-04.html#5.4 http://archive.adaic.com/standards/83lrm/html/lrm-05-04.html...
- jandrese 6y agoI have no idea what my professor was on about then. I remember him showing a slide of this ridiculous looking if/then/elseif... chain compared to a C switch statement.