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

Liste des GroupesRevenir à cl c 
Sujet : Re: technology discussion → does the world need a "new" C ?
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.c
Date : 16. Aug 2024, 15:19:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9nn5q$1f3op$1@dont-email.me>
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 : Mozilla Thunderbird
On 16/08/2024 01:08, Ben Bacarisse 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.
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?

Date Sujet#  Auteur
15 Aug 24 * Re: technology discussion → does the world need a "new" C ?45Tim Rentsch
15 Aug 24 `* Re: technology discussion → does the world need a "new" C ?44Bart
15 Aug 24  +* Re: technology discussion → does the world need a "new" C ?35Ben Bacarisse
15 Aug 24  i`* Re: technology discussion → does the world need a "new" C ?34Bart
16 Aug 24  i +* Re: technology discussion → does the world need a "new" C ?30Ben Bacarisse
16 Aug 24  i i+* Re: technology discussion → does the world need a "new" C ?6Michael S
16 Aug 24  i ii+* Re: technology discussion → does the world need a "new" C ?4Keith Thompson
16 Aug 24  i iii`* Re: technology discussion → does the world need a "new" C ?3Michael S
16 Aug 24  i iii +- Re: technology discussion → does the world need a "new" C ?1Bart
16 Aug 24  i iii `- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
16 Aug 24  i ii`- Re: technology discussion → does the world need a "new" C ?1Ben Bacarisse
16 Aug 24  i i+* Re: technology discussion → does the world need a "new" C ?12David Brown
16 Aug 24  i ii+* Re: technology discussion → does the world need a "new" C ?8Ben Bacarisse
16 Aug 24  i iii`* Re: technology discussion → does the world need a "new" C ?7David Brown
19 Aug 24  i iii `* Re: technology discussion → does the world need a "new" C ?6Ben Bacarisse
19 Aug 24  i iii  `* Re: technology discussion → does the world need a "new" C ?5Tim Rentsch
19 Aug 24  i iii   `* Re: technology discussion → does the world need a "new" C ?4David Brown
19 Aug 24  i iii    +- Re: technology discussion → does the world need a "new" C ?1Michael S
19 Aug 24  i iii    `* Re: technology discussion → does the world need a "new" C ?2Ben Bacarisse
19 Aug 24  i iii     `- Re: technology discussion → does the world need a "new" C ?1David Brown
16 Aug 24  i ii`* Re: technology discussion → does the world need a "new" C ?3Keith Thompson
17 Aug 24  i ii +- Re: technology discussion → does the world need a "new" C ?1David Brown
17 Aug 24  i ii `- Re: technology discussion → does the world need a "new" C ?1Bart
16 Aug 24  i i`* Re: technology discussion → does the world need a "new" C ?11Bart
17 Aug 24  i i +* Re: technology discussion → does the world need a "new" C ?4Tim Rentsch
17 Aug 24  i i i`* Re: technology discussion → does the world need a "new" C ?3Bart
18 Aug 24  i i i `* Re: technology discussion → does the world need a "new" C ?2Tim Rentsch
18 Aug 24  i i i  `- Re: technology discussion → does the world need a "new" C ?1Bart
19 Aug 24  i i `* Re: technology discussion → does the world need a "new" C ?6Ben Bacarisse
19 Aug 24  i i  `* Re: technology discussion → does the world need a "new" C ?5Bart
19 Aug 24  i i   `* Re: technology discussion → does the world need a "new" C ?4Ben Bacarisse
19 Aug 24  i i    `* Re: technology discussion → does the world need a "new" C ?3Bart
20 Aug 24  i i     `* Re: technology discussion → does the world need a "new" C ?2Ben Bacarisse
20 Aug 24  i i      `- Re: technology discussion → does the world need a "new" C ?1Bart
16 Aug 24  i `* Re: technology discussion → does the world need a "new" C ?3David Brown
16 Aug 24  i  `* Re: technology discussion → does the world need a "new" C ?2Bart
16 Aug 24  i   `- Re: technology discussion → does the world need a "new" C ?1David Brown
15 Aug 24  +* Re: technology discussion → does the world need a "new" C ?7Tim Rentsch
15 Aug 24  i`* Re: technology discussion → does the world need a "new" C ?6Bart
16 Aug 24  i `* Re: technology discussion → does the world need a "new" C ?5Kaz Kylheku
16 Aug 24  i  `* Re: technology discussion → does the world need a "new" C ?4Bart
16 Aug 24  i   +- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
16 Aug 24  i   `* Re: technology discussion → does the world need a "new" C ?2tTh
16 Aug 24  i    `- Re: technology discussion → does the world need a "new" C ?1Bart
15 Aug 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