Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bob Eager 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: References: <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> <1r0e6u9.1tubjrt1kapeluN%snipeco.2@gmail.com> <20240925083451.00003205@gmail.com> <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) Xref: csiph.com alt.folklore.computers:227546 comp.os.linux.misc:59069 On Thu, 03 Oct 2024 16:34:15 -0700, Peter Flass wrote: > Louis Krupp 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