Deutsch English Français Italiano |
<87plv6jv1i.fsf@nosuchdomain.example.com> 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: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Command Languages Versus Programming Languages Date: Wed, 03 Apr 2024 09:00:25 -0700 Organization: None to speak of Lines: 34 Message-ID: <87plv6jv1i.fsf@nosuchdomain.example.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 03 Apr 2024 16:00:34 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a67faaad1a2f17d94ae762a9e9871bf2"; logging-data="35184"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tWxYn4nXgVu9iJxdNr+YE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:A89/7wvR9zKbeODaOOgvUK4r2mU= sha1:e1DnGyJG214lrbIxruA6I5QgamY= Bytes: 3072 David Brown <david.brown@hesbynett.no> writes: > On 03/04/2024 02:23, Lawrence D'Oliveiro wrote: >> On 2 Apr 2024 08:26:14 GMT, Stefan Ram wrote: >> >>> ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted: >>> >>>> def diff( x ): >>>> return 1 if x == 'x' else 0 if type( x )is str else[ 'sum', diff( x[ >>>> 1 ]), diff( x[ 2 ])] >>>> if x[ 0 ]== 'sum' else None >>> >>> Oops! That was one long line starting with "return"; >>> it was wrapped by the newsreader, but is not correct Python anymore >>> when wrapped this way. >> It’s bloody horrible Python even when wrapped correctly. I think >> Python’s version of the conditional expression is a complete >> abortion. > > That's probably the reason almost no one uses it. That post is the > first time I have ever seen conditional expressions outside of a brief > mention in a tutorial on Python conditionals showing how to write > normal conditionals in the language. I think Python stole this one > from Perl. No, Perl's conditional expressions use the same syntax as C's. As for whether Python's conditional expression syntax, it's not clear that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else expr2) (unless you happen to be familiar with one of them). -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Medtronic void Void(void) { Void(); } /* The recursive call of the void */