Deutsch English Français Italiano |
<874j7ep7ev.fsf@bsb.me.uk> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse <ben@bsb.me.uk> Newsgroups: comp.lang.c Subject: Re: on allowing "int a" definition everywhere Date: Wed, 21 Aug 2024 10:11:20 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: <874j7ep7ev.fsf@bsb.me.uk> References: <afdfe7c37c6ad739fd82c7ec0587b82e0963fce2@i2pn2.org> <va3n09$3nnl8$1@dont-email.me> <87cym2p9ti.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 21 Aug 2024 11:11:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="fbbdc6bc93fc8e09c145618243cc2ab3"; logging-data="3991012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QJ4rSPQJGMJR9x3B84z96b+Pti3eG1Vk=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:eFtpt971G3VpEgToGXvPdAKywnU= sha1:Y/b8D9nLunC8MBph3ClH8qsp384= X-BSB-Auth: 1.6b4926a3fd5a7d2981d6.20240821101120BST.874j7ep7ev.fsf@bsb.me.uk Bytes: 2123 Ben Bacarisse <ben@bsb.me.uk> writes: > Lawrence D'Oliveiro <ldo@nz.invalid> writes: > >> On Tue, 20 Aug 2024 18:48:17 +0200, fir wrote: >> >>> got some thought today thet simply probably allowing to define "int a" >>> everywhere could be just simply a good c (or other language) design >>> decision >> >> Somehow along the line from BCPL to B to C, one useful feature was lost: >> the ability to have a value-returning statement block inside an >> expression. > > It was lost in the BCPL to B transition. Interestingly, it's an old idea the existed in both of C's main progenitors, and yet is still got lost. BCPL was influenced by CPL, so BCPL's valof/resultis expression is similar to CPL's result of {... result := ...} form. But Ritchie also cites Algol 68 as an influence on C, and in Algol 68 /all/ blocks have a value (but the type is sometimes void). Thompson must have thought it not worth preserving in B, and no one thought to put it back into C when thinking about Algol 68. -- Ben.