Re: technology discussion → does the world need a "new" C ?

Liste des GroupesRevenir à l c 
Sujet : Re: technology discussion → does the world need a "new" C ?
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.c
Date : 16. Aug 2024, 10:10:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240816121015.0000579b@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Fri, 16 Aug 2024 01:08:15 +0100
Ben Bacarisse <ben@bsb.me.uk> wrote:

Bart <bc@freeuk.com> writes:
 
On 15/08/2024 15:33, Ben Bacarisse wrote: 
Bart <bc@freeuk.com> writes:
 
On 15/08/2024 09:43, Tim Rentsch wrote: 
Bart <bc@freeuk.com> 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.
 
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.
>


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.


Date Sujet#  Auteur
5 Jul 24 * Re: technology discussion → does the world need a "new" C ?305BGB
5 Jul 24 +* Re: technology discussion → does the world need a "new" C ?2Lawrence D'Oliveiro
5 Jul 24 i`- Re: technology discussion → does the world need a "new" C ?1yeti
15 Jul 25 +- 
5 Jul 24 `* Re: technology discussion → does the world need a "new" C ?26bart
5 Jul 24  +- Re: technology discussion → does the world need a "new" C ?1BGB
6 Jul 24  `* Re: technology discussion → does the world need a "new" C ?24Lawrence D'Oliveiro
6 Jul 24   +* Re: technology discussion → does the world need a "new" C ?17Keith Thompson
6 Jul 24   i+- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
6 Jul 24   i`* Re: technology discussion → does the world need a "new" C ?15Lawrence D'Oliveiro
6 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Ben Bacarisse
6 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
7 Jul 24   i +* Re: technology discussion → does the world need a "new" C ?10James Kuyper
10 Jul 24   i i`* Re: technology discussion → does the world need a "new" C ?9Lawrence D'Oliveiro
10 Jul 24   i i `* Re: technology discussion → does the world need a "new" C ?8James Kuyper
11 Jul 24   i i  `* Re: technology discussion → does the world need a "new" C ?7Lawrence D'Oliveiro
11 Jul 24   i i   +* Re: technology discussion → does the world need a "new" C ?2David Brown
11 Jul 24   i i   i`- Re: technology discussion → does the world need a "new" C ?1Malcolm McLean
11 Jul 24   i i   +* Re: technology discussion → does the world need a "new" C ?3bart
11 Jul 24   i i   i`* Re: technology discussion → does the world need a "new" C ?2Chris M. Thomasson
12 Jul 24   i i   i `- Re: technology discussion → does the world need a "new" C ?1Chris M. Thomasson
11 Jul 24   i i   `- Re: technology discussion → does the world need a "new" C ?1James Kuyper
7 Jul 24   i +- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
25 Aug 24   i `- Re: technology discussion ? does the world need a "new" C ?1dave thompson 2
6 Jul 24   +- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
6 Jul 24   +- Re: technology discussion → does the world need a "new" C ?1James Kuyper
6 Jul 24   `* Re: technology discussion → does the world need a "new" C ?4bart
7 Jul 24    `* Re: technology discussion → does the world need a "new" C ?3Keith Thompson
7 Jul 24     `* Re: technology discussion → does the world need a "new" C ?2bart
7 Jul 24      `- Re: technology discussion → does the world need a "new" C ?1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal