Deutsch English Français Italiano |
<uup8ul$1fr2t$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Command Languages Versus Programming Languages Date: Fri, 5 Apr 2024 18:30:12 +0200 Organization: A noiseless patient Spider Lines: 48 Message-ID: <uup8ul$1fr2t$1@dont-email.me> References: <uu54la$3su5b$6@dont-email.me> <uu636l$7haj$1@dont-email.me> <20240329084454.0000090f@gmail.com> <uu6om5$cmv8$1@dont-email.me> <20240329101248.556@kylheku.com> <uu6t9h$dq4d$1@dont-email.me> <20240329104716.777@kylheku.com> <uu8p02$uebm$1@dont-email.me> <20240330112105.553@kylheku.com> <uudrfg$2cskm$1@dont-email.me> <87r0fp8lab.fsf@tudado.org> <uuehdj$2hshe$1@dont-email.me> <87wmpg7gpg.fsf@tudado.org> <LISP-20240402085115@ram.dialup.fu-berlin.de> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 05 Apr 2024 16:30:13 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7bb916d2050ea2724cd5f30d6d12a41b"; logging-data="1567837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19D9g6Ifm/ECy8od+SQ56B4" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:Goxp2Mhh1ey92dnaV47ld37BqAY= In-Reply-To: <uund4g$ugsb$1@dont-email.me> X-Enigmail-Draft-Status: N1110 Bytes: 3272 On 05.04.2024 01:29, Lawrence D'Oliveiro wrote: > On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote: > >> And let me tell you, when you start getting into that kind of nested >> stuff with not parentheses in view, even the "?:" notation can start >> looking pretty darn mysterious to some folks. > > This is where indentation helps. E.g. > > a = > b ? > c ? d : e > : f ? > g ? h : i > : j; > Indentation generally helps. In above code (in my book) it's not that clear [from the indentation], e.g. where the last ':' 'else' belongs to. So I'd have lined the colons up with the respective '?'. (YMMV.) Not all languages differentiate (per syntax) a conditional command from a conditional expression. Here are the two forms supported by Algol for both, statements and expressions (here the examples are both depicted for expressions only) a := ( b | ( c | d | e ) | ( f | ( g | h | i ) | j ) ); The parenthesis are not used for grouping, but are the alternative form for IF/THEN/ELSE/FI a := IF b THEN IF c THEN d ELSE e FI ELSE IF f THEN IF g THEN h ELSE i FI ELSE j FI FI Pick your choice depending on the case (or taste). Janis