Deutsch English Français Italiano |
<vdoklu$767l$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: The Natural Philosopher <tnp@invalid.invalid> Newsgroups: alt.folklore.computers,comp.os.linux.misc Subject: Re: TeX and Pascal [was Re: The joy of FORTRAN] Date: Fri, 4 Oct 2024 12:48:14 +0100 Organization: A little, after lunch Lines: 68 Message-ID: <vdoklu$767l$2@dont-email.me> References: <pan$96411$d204da43$cc34bb91$1fe98651@linux.rocks> <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> <vcub5c$36h63$1@dont-email.me> <1r0e6u9.1tubjrt1kapeluN%snipeco.2@gmail.com> <vcuib9$37rge$5@dont-email.me> <vcvuhh$3hroa$2@dont-email.me> <llhieuF8ej2U2@mid.individual.net> <20240925083451.00003205@gmail.com> <Pascal-20240925164718@ram.dialup.fu-berlin.de> <mdd4j63pmo1.fsf_-_@panix5.panix.com> <oJ-cnQSrLZDYdGX7nZ2dnZfqnPWdnZ2d@earthlink.com> <vdatb6$1l4ch$8@dont-email.me> <vdauah$1lq1u$1@dont-email.me> <lltt6uF4fseU4@mid.individual.net> <vdcn1q$1tmdr$5@dont-email.me> <vddqoe$264fi$2@dont-email.me> <vdf4le$2cn51$6@dont-email.me> <vdh2l1$2p7e2$1@dont-email.me> <vdh3ku$2path$1@dont-email.me> <vdhqnf$2t1fi$4@dont-email.me> <e6tLO.276711$FzW1.154698@fx14.iad> <2028019001.749690291.329651.peter_flass-yahoo.com@news.eternal-september.org> <lma03qFmmqaU35@mid.individual.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 04 Oct 2024 13:48:15 +0200 (CEST) Injection-Info: dont-email.me; posting-host="3e495bff133823aa2acdd6f619ee470d"; logging-data="235765"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DqUtjBzrGKSTfkSOl8GacJRo/xGkTorY=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:EHxeYuL0KHu+twsliZsNNMG8oCM= In-Reply-To: <lma03qFmmqaU35@mid.individual.net> Content-Language: en-GB Bytes: 3744 On 04/10/2024 11:59, Bob Eager wrote: > On Thu, 03 Oct 2024 16:34:15 -0700, Peter Flass wrote: > >> Louis Krupp <lkrupp@invalid.pssw.com.invalid> wrote: >>> On 10/1/2024 3:48 PM, Lawrence D'Oliveiro wrote: >>>> On Tue, 1 Oct 2024 16:14:37 +0100, The Natural Philosopher wrote: >>>> >>>>> And knowing that p=(x>y?3:2); >>>> I would have done it without the parentheses. There’s too much >>>> parenthesis clutter around as it is. >>> >>> Add some spaces, and you've got something downright readable: >>> >>> p = x > y ? 3 : 2; >>> >>> Maybe add parentheses around the comparison, especially if it's long or >>> complex, which this isn't: >>> >>> p = (x > y) ? 3 : 2; >>> >>> It's idiomatic C. It's everywhere. Perl and Python have something >>> similar. So does Unisys ALGOL, not that anyone cares: >>> >>> P := IF X > Y THEN 3 ELSE 2; >>> >>> If you want to see gratuitous cleverness for the sake of cleverness, >>> there's this: >>> >>> p = (x > y) + 2; >>> >>> Please don't do that. Would you write: >>> >>> P := REAL((X > Y) AND TRUE) + 2; >>> >>> if you were doing this in ALGOL? >>> >>> I didn't think so. >>> >>> Louis >>> >>> >>> >>> >>> >> I like the Unisys version. At the cost of a couple of characters it’s >> readable. The C version is not straightforward for those of us for whom >> C is a second or third language. > > The C version, of course, was merely a syntactic change from the BCPL > version (on which, via B, it was based): > > p := (x > y) -> 3, 2 > > (parentheses optional) > One less keystroke in C. [:=] -> [=] -1 [->] -> [?] -2 blank EOL to [;] +1 -- How fortunate for governments that the people they administer don't think. Adolf Hitler