Deutsch English Français Italiano |
<vaemm8$1q5l3$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Sebastian <sebastian@here.com.invalid> Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Command Languages Versus Programming Languages Date: Sun, 25 Aug 2024 07:32:26 -0000 (UTC) Organization: A noiseless patient Spider Lines: 54 Message-ID: <vaemm8$1q5l3$1@dont-email.me> References: <uu54la$3su5b$6@dont-email.me> <LISP-20240402091729@ram.dialup.fu-berlin.de> <wrap-20240402092558@ram.dialup.fu-berlin.de> <uui7hf$3gona$1@dont-email.me> <uuj1o5$3pvnq$1@dont-email.me> <87plv6jv1i.fsf@nosuchdomain.example.com> <wwv5xwyifq8.fsf@LkoBDZeT.terraraq.uk> <if-20240404121825@ram.dialup.fu-berlin.de> <uund4g$ugsb$1@dont-email.me> <uup8ul$1fr2t$1@dont-email.me> <indentation-20240405183703@ram.dialup.fu-berlin.de> <v8sleh$1g9s4$1@dont-email.me> <v8ubtt$1u86k$1@dont-email.me> Injection-Date: Sun, 25 Aug 2024 09:32:26 +0200 (CEST) Injection-Info: dont-email.me; posting-host="9279a399661a58fbc808a307433981c4"; logging-data="1906339"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ztU4y1kTYT7WfpLifqD4iNdBvHnZvX6A=" User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64)) Cancel-Lock: sha1:xMy9/VCcJpeMiyJ8/TnXZGVE6bo= Bytes: 2526 In comp.unix.programmer 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; I find this more confusing than the parentheses. >> 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 > ) If you insist on writing Lisp like that, you might as well do this: (ql:quickload :with-c-syntax) (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ a = b ? (c ? d : e) : f ? (g ? h : i) : j; #}