[Csnd-dev] break and continue

Victor Lazzarini <[email protected]> Mon, 13 Oct 2025 11:11:29 +0000
Newsgroups gmane.comp.audio.csound.devel
Message-ID <[email protected]>
Hi all,

with thanks to @scottsitar we now have break and continue in while, until, and
for loops. 

What we’d like to discuss here now is how switch should be handled. At the
moment, switch has an implicit break. This means it cannot be used in fall-through
scenarios (as far as I can see). Discussing briefly this in the PR we considered two
options:

(a) modify switch to take an explicit break (like in C)
(b) add a fall-through statement (like in go)

The advantage of (a) is that we don’t need a new keyword and we are in line with
the most common approach (?). The advantage of (b) is that no user-level changes
to switch are needed.

I have no preference myself. Would be interesting to hear opinions.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland