Liste des Groupes | Revenir à cl c |
On 03/11/2024 01:21, fir wrote:coz ypu dont need to provide such branchBart wrote:>>>
It's a mess. By contrast, my if statements look like this:
>
if then elsif then ... [else] fi
>
>
'elsif' is a part of the syntax. The whole thing can return a value.
There is a compact form (not for elsif, that would be too much) as shown
above.
>
as to if when thinking of it the if construct has such parts
>
if X then S else E
>
and the keyword if is not necessary imo as the expression x return
logical value them then can be used on this without if
>
X then {}
X else {}
>
i would prefer to denote (at least temporerely) then as ->
and else as ~> then you can build construct like
>
>
a -> b -> c -> d ~> e ~> f
>
when the arrows take logical value of the left
(if a true then b, if be true then c if c true then d,if
d false then e and if e false then f)
>
but some need also to use else to some previous espression and
i think how it could be done but maybe just parenthesis can be used
>
a (->b->c) ~>z
>
if a true then b and if b true then c but if a false then z
>
C already has this (I've added parentheses for clarity):
>
(a ? (b ? c : -) : z)
>
This shows you haven't provided a branch for b being false.
>
Also it's not clear if you intended for b to be evaluated twice; I'vewhy twice? -> just goes forward on true and ~> goes forward on fales
assumed only once as it is nonsense otherwise.
>
Les messages affichés proviennent d'usenet.