Sujet : Re: on allowing "int a" definition everywhere
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.cDate : 21. Aug 2024, 10:11:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <874j7ep7ev.fsf@bsb.me.uk>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13)
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.