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, 12 Jul 2024 09:54:46 -0700 Organization: None to speak of Lines: 34 Message-ID: <87sewesg89.fsf@nosuchdomain.example.com> References: <877cdur1z9.fsf@bsb.me.uk> <871q42qy33.fsf@bsb.me.uk> <87ed82p28y.fsf@bsb.me.uk> <87r0c1nzjj.fsf@bsb.me.uk> <87ikxconq4.fsf@bsb.me.uk> <20240711115418.00001cdf@yahoo.com> <20240712045301.394@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 12 Jul 2024 18:54:50 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f6a4ae00b1d1f7396bcd7741519ff487"; logging-data="3282208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18flEPzVKk1WkNapBEjVju5" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:o+fiLOMKAZBdeV8079N8BjewxmM= sha1:w5dUZIzU2Anf30yUnVyRBzKkQdU= Xref: csiph.com comp.lang.c:387104 Kaz Kylheku <643-408-1753@kylheku.com> writes: > On 2024-07-12, bart wrote: >> It's clearly not by value. It's apparently not by reference. You can't >> get away with saying they are not passed, as clearly functions *can* >> access array data via parameters. > > Actually, you probably can get away with saying that it is "passed > by reference". > > The formal term that doesn't apply is "call by reference"; that's what > C doesn't have. > > "call by reference" emphasizes that the function call mechanism > provides the reference semantics for a formal parameter, not that some > arbitrary means of passage of the data has reference semantics. [...] I know that "call by reference" is the usual formal term, but I personally prefer "pass by reference". The terms "call by reference" and "call by value" emphasize the call, implying that all arguments in a given call are passed with the same mechanism. In some languages that's true (C argument passing is purely by value, and Fortran, as I understand it, is purely by reference), but in others (C++, Pascal, Ada) you can select by-value or by-reference for each parameter. "Pass by (reference|value)" feels more precise. I haven't checked, but I suspect the terms "call by (reference|value)" predate languages that allowed the mechanism to be specified for each parameter. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */