Liste des Groupes | Revenir à cl c |
On 11/07/2024 00:01, Ben Bacarisse wrote:
>bart <bc@freeuk.com> writes:>
>On 10/07/2024 14:32, Ben Bacarisse wrote:>
>
I still consider arrays in C to be 'passed' by a
mechanism which is near-indistinguishable from actual
pass-by-reference.
I don't really care how you consider it, but I do care about how you
misrepresent the facts in public.
>
In another post you said that your language has pass by reference, and
we also know you have implemented C. Either you are just very confused
and your language simply has call by value (after all, you think C has
pass by reference), or you know that pass by reference in your language
needs something from the implementation that was not needed when you
implemented C. I can't decide if you are confused or just lying.
The way it works in my language is very simple (this is what I do
after all):
>
type T = int
>
proc F(T x)= # Pass by value
println x.typestr
end
>
proc G(ref T x)= # Manual pass-by-reference
println x^.typestr
end
>
proc H(T &x)= # Auto pass-by-reference
println x.typestr
end
>
proc main=
T a
>
F(a)
G(&a)
H(a)
end
>
I've written 3 functions using pass-by-value, pass-by-value emulating
pass-by-reference, and actual pass-by-reference. [...]
Les messages affichés proviennent d'usenet.