Sujet : Re: Command Languages Versus Programming Languages
De : a_eder_muc (at) *nospam* web.de (Andreas Eder)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscSuivi-à : posterDate : 08. Aug 2024, 16:25:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87ttfv6np9.fsf@eder.anydns.info>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.13 (Gnus v5.13)
On Di 06 Aug 2024 at 23:34, Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Tue, 6 Aug 2024 08:04:35 -0000 (UTC), Sebastian wrote:
>
Better:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
>
Better still (fewer confusing parentheses):
>
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
>
Equivalent Lisp, for comparison:
(setf a (cond (b (if c d e))
(f (if g h i))
(t j)))
>
You can’t avoid the parentheses, but this, too, can be improved:
>
(setf a
(cond
(b
(if c d e)
)
(f
(if g h i)
)
(t
j
)
) ; cond
)
Sorry, but that is not an improvement but rather an abomination.
'Andreas
-- ceterum censeo redmondinem esse delendam