Liste des Groupes | Revenir à cl c |
On 02/11/2024 21:44, Bart wrote:
I missed this part of a very long post until JP commented on it.(Note that the '|' is my example is not 'or'; it means 'then':Ah, so your language has a disastrous choice of syntax here so that sometimes "a | b" means "or", and sometimes it means "then" or "implies", and sometimes it means "else".
>
( c | a ) # these are exactly equivalent
if c then a fi
>
( c | a | b ) # so are these [fixed]
if c then a else b fi
>
There is no restriction on what a and b are, statements or expressions, unless the whole returns some value.)
Why have a second syntax with a confusing choice of operators when you have a perfectly good "if / then / else" syntax?if/then/else suits multi-line statements. (||) suits terms that are part of a larger one-line expression.
Or if you feel an operator adds a lot to the language here, why not choose one that would make sense to people, such as "=>" - the common mathematical symbol for "implies".It is not an operator, it is part of '(x | x,x,x | x)' syntax.
Les messages affichés proviennent d'usenet.