implement arbitrary octave switch