Thread: Midi <-> OSC
View Single Post
Old 11-17-2017, 02:53 PM   #76
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,690
Default

Quote:
Originally Posted by Justin View Post
There is no switch equivalent in EEL2...
IMHO no problem at all. Doing

Code:
a==1 ? (
  ...
 ) : a == 2 ? (
  ...
 ) : a == 3 ? (
  ...
 ) : a == 4 ? (
  ...
 ) : a == 5 ? (
  ...
);
is neither that much more writing nor worse readable than a switch construct.

If "a" contains an integer, the "switch" code could be optimized to use a calculated jump. But if "a" is a string (and the compare would us match() ) this would not be possible, either.

-Michael

Last edited by mschnell; 11-17-2017 at 11:36 PM.
mschnell is offline   Reply With Quote