Deutsch   English   Français   Italiano  
<lma03qFmmqaU35@mid.individual.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Bob Eager <news0009@eager.cx>
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: TeX and Pascal [was Re: The joy of FORTRAN]
Date: 4 Oct 2024 10:59:07 GMT
Lines: 59
Message-ID: <lma03qFmmqaU35@mid.individual.net>
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>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net KvIWJ6Dye92nQfCTTILn6AorixoFpJUuNAHHkGv2ZeSiDdV/Z5
Cancel-Lock: sha1:9+FjCqTKnUrGRfsATzFexdZWMEs= sha256:z+6BZAfxAu2OVnKtrWbCS7E1rxw7G1AWEqvbUXR2uQs=
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
 git.gnome.org/pan2)
Bytes: 3250

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)

-- 
Using UNIX since v6 (1975)...

Use the BIG mirror service in the UK:
 http://www.mirrorservice.org