Liste des Groupes | Revenir à cl c |
Bart <bc@freeuk.com> wrote:I assume that you consider the simple solution the 'bad' one?On 05/11/2024 12:42, Waldek Hebisch wrote:Well, frequently it is easier to do bad job, than a good one.Bart <bc@freeuk.com> wrote:>>>
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.
>
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...
>
...or to just always require 'else', with a dummy value if necessary?
normally you do not need very complex analysis:I don't want to do any analysis at all! I just want a mechanical translation as effortlessly as possible.
Les messages affichés proviennent d'usenet.