Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Bart Newsgroups: comp.lang.c Subject: =?UTF-8?Q?Re=3A_technology_discussion_=E2=86=92_does_the_world_need?= =?UTF-8?B?IGEgIm5ldyIgQyA/?= Date: Fri, 16 Aug 2024 15:19:38 +0100 Organization: A noiseless patient Spider Lines: 63 Message-ID: References: <87ikxconq4.fsf@bsb.me.uk> <20240711115418.00001cdf@yahoo.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 16 Aug 2024 16:19:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="41b943bbe22b81dd70cf2db8d8e89fb0"; logging-data="1543961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OlBdUK+FfoXkmOn93rrn6" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:gOsAlD6xSBPjf9zlaLvjCJ3nWD0= In-Reply-To: <87sev5s51s.fsf@bsb.me.uk> Content-Language: en-GB Bytes: 4267 On 16/08/2024 01:08, Ben Bacarisse wrote: > Bart writes: > >> On 15/08/2024 15:33, Ben Bacarisse wrote: >>> Bart writes: >>> >>>> On 15/08/2024 09:43, Tim Rentsch wrote: >>>>> Bart writes: >> >>>>> C call-by-value call-by-reference >>>>> =============== ================= >>>>> at call: >>>>> >>>>> (array argument) F(A) H(A) >>>>> >>>>> (pointer argument) F(p) (disallowed) >>>> >>>> My posts were about passing *arrays* and the fact that C's pass-by-value >>>> was remarkably similar to pass-by-reference. >>> Which is why, presumably, you didn't show the differences. Your >>> post was all polemic not part of a collegiate discussion of the >>> similarities and differences. >>> >>>> However your entry for pointers is not correct: >>> No, the entry is correct. H(p) would be (is?) disallowed when H's >>> parameter is a reference to an array. >> >> Sorry, what language does the right-hand column pertain to? /Any/ language >> that has call-by-reference, or Tim's hypthetical language? > > Tim said that case was "disallowed". You call that an error on his > part. What language did you have in mind that permits such a gross > warping of types? I would describe /any/ language that allowed it as > having a design error. You or he would have to go into more detail, such as an actual example, to demonstrate whatever it is that you think is wrong about passing a pointer argument by-reference. I assume here that the language in the right column is not C. > >> Or any that could be used to prove him right? >> >> In general there is no reason, in a language with true call-by-reference, >> why any parameter type T (which has the form U*, a pointer to anything), >> cannot be passed by reference. It doesn't matter whether U is an array type >> or not. > > I can't unravel this. Take, as a concrete example, C++. You can't pass > a pointer to function that takes an array passed by reference. You can, > of course, pass a pointer by reference, but that is neither here nor > there. OK. So why do you agree with this: >>>>> C call-by-value call-by-reference >>>>> =============== ================= >>>>> (pointer argument) F(p) (disallowed) What is 'pointer argument' here?