Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: technology discussion =?utf-8?Q?=E2=86=92?= does the world need a "new" C ? Date: Fri, 16 Aug 2024 11:40:53 -0700 Organization: None to speak of Lines: 44 Message-ID: <878qwwe2fe.fsf@nosuchdomain.example.com> References: <20240712154252.00005c2f@yahoo.com> <86o7717jj1.fsf@linuxsc.com> <20240717163457.000067bb@yahoo.com> <86a5hep45h.fsf@linuxsc.com> <87y14xsvnh.fsf@bsb.me.uk> <87sev5s51s.fsf@bsb.me.uk> <20240816121015.0000579b@yahoo.com> <87r0aoesh4.fsf@nosuchdomain.example.com> <20240816123810.0000420d@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 16 Aug 2024 20:41:07 +0200 (CEST) Injection-Info: dont-email.me; posting-host="1d04e40206551ed72fc82578ee5a10bf"; logging-data="1604522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nlM/3cpv1oZpYvpMKCMtK" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:r1YpFaO1GnW8oZj/2eDPX7Zg6H8= sha1:Q8bSN1em4ZJBXy5ikgnof6CzkII= Xref: csiph.com comp.lang.c:387615 Michael S writes: > On Fri, 16 Aug 2024 02:18:15 -0700 > Keith Thompson wrote: > >> Michael S writes: >> [...] >> > IMHO, C++ is a particularly bad example. >> > Yes, C++ has call-by-reference misfeature. But arrays in C++ are >> > 2nd class citizen, same as in C. They can't be assigned and can't be >> > passed to callee, neither by value nor by reference. >> > >> > Also, I suspect that if you ask Ken Thompson, he will tell you that >> > C++ does not really have 'call by reference'. Instead, it has >> > references as 1st class object, so, naturally, values of references >> > can be used during 'call by value'. >> > I have enough of respect to KT to consider that his POV is not a >> > nonsense. >> >> Is that an attempt at proof by authority? > > Yes! > >> Not only does Ken Thompson >> have very little to do with C++, but you're basing your conclusion on >> what you *suspect* he would say. >> > > Yes, but it's not baseless. > It is based on following section Go language FAQs that I assumed to be > either authored or approved by KT. > https://go.dev/doc/faq#pass_by_value "As in all languages in the C family, everything in Go is passed by value." C++ clearly has what it calls "references", and parameters can be of reference type. If you want to argue that C++ doesn't really have call by reference, I suggest basing your argument on a document that Ken Thompson may or may not have had any hand in writing, and that could easily have a mistake. I also suggest you do it elsewhere. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */