Liste des Groupes | Revenir à cl c |
On 05/11/2024 12:42, Waldek Hebisch wrote:If this was a discussion on learning about compiler design for newbies, that might be a relevant point. Otherwise, what is easier to implement in a language tool is completely irrelevant to what is good in a language.Bart <bc@freeuk.com> wrote:What's easier to implement in a language: to have a conditional need for an 'else' branch, which is dependent on the compiler performing some arbitrarily complex levels of analysis on some arbitrarily complex set of expressions...>>
Then we disagree on what 'multi-way' select might mean. I think it means
branching, even if notionally, on one-of-N possible code paths.
OK.The whole construct may or may not return a value. If it does, then one>
of the N paths must be a default path.
>
You need to cover all input values. This is possible when there
is reasonably small number of possibilities. For example, switch on
char variable which covers all possible values does not need default
path. Default is needed only when number of possibilities is too
large to explicitely give all of them. And some languages allow
ranges, so that you may be able to cover all values with small
number of ranges.
>
...or to just always require 'else', with a dummy value if necessary?
Les messages affichés proviennent d'usenet.