Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Bart Newsgroups: comp.lang.c Subject: Re: else ladders practice Date: Sat, 9 Nov 2024 12:21:47 +0000 Organization: A noiseless patient Spider Lines: 66 Message-ID: References: <3deb64c5b0ee344acd9fbaea1002baf7302c1e8f@i2pn2.org> <78eabb4054783e30968ae5ffafd6b4ff2e5a5f17@i2pn2.org> <6724CFD2.4030607@grunge.pl> <2491a699388b5891a49ef960e1ad8bb689fdc2ed@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 09 Nov 2024 13:21:49 +0100 (CET) Injection-Info: dont-email.me; posting-host="3a299272b8862feb369542603f9244e6"; logging-data="3978438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198NknLymHl4JFiAHWpRcHC" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:9pGzNE9F5veE01qC5s3K3WS3wIM= In-Reply-To: Content-Language: en-GB Bytes: 3636 On 09/11/2024 03:57, Janis Papanagnou wrote: > On 08.11.2024 23:24, Bart wrote: >> On 08/11/2024 17:37, Janis Papanagnou wrote: >>> >>> BTW, the same symbols can also be used as an alternative form >>> of the 'case' statement; the semantic distinction is made by >>> context, e.g. the types involved in the construct. >> >> You mean whether the 'a' in '(a | b... | c)' has type Bool rather than Int? >> >> I've always discriminated on the number of terms between the two |s: >> either 1, or more than 1. > > I suppose in a [historic] "C" like language it's impossible to > distinguish on type here (given that there was no 'bool' type > [in former times] in "C"). - But I'm not quite sure whether > you're speaking here about your "C"-like language or some other > language you implemented. I currently have three HLL implementations: * For my C subset language (originally I had some enhancements, now dropped) * For my 'M' systems language inspired by A68 syntax * For my 'Q' scripting language, with the same syntax, more or less The remark was about those last two. >> if cond then >> s1 >> s2 >> else >> s3 >> s4 >> end > > (Looks a lot more like a scripting language without semicolons.) This is what I've long suspected: that people associate clear, pseudo-code-like syntax with scripting languages. 'Serious' ones apparently need to look the business with a lot of extra punctuation. The more clutter the better! By that criteria, C++ is obviously more advanced than C: C: #include printf("A=%d B=%d\n", a, b); C++ #include std::cout << "A=" << a << " " << "B=" << b << std::endl; Maybe Zig even more so (normally you'd create a shorter alias to that print): Zig: @import("std").debug.print("A={d} B={d}\n", .{a, b}); By that measure, mine probably looks like a toy: M: println =a, =b