Re: Language design issue: reference types, or pass-by-reference?
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Thu, 18 Jun 2009 18:55:40 -0400
Nick Keighley wrote:
Michael Ekstrand <mich...@xxxxxxxxxxx> wrote:
Charlie Dawson <cd4...@xxxxxxxxx> writes:
The Java solution is simpler, but I can't help feeling that
it's not the right way to do references. It feels like a bodge.
I tend to prefer the Java solution.
The C++ solution does have some elegance; however, the lack of
syntax indicating pass-by-reference at the call site means that
it is not obvious when a function call may modify one of its
parameters.
good. That was a nasty bodge in C.
What bodge? If the parameter isn't a pointer, the function can't
modify the value. If it is a pointer, the simple use of 'const'
prevents modification. All right out in the open. C doesn't
implement pass by reference. It has adequate faults, but this
isn't one of them. If you suppress the error messages that's your
problem.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.
- References:
- Re: Language design issue: reference types, or pass-by-reference?
- From: Nick Keighley
- Re: Language design issue: reference types, or pass-by-reference?
- Prev by Date: Re: Airlines
- Next by Date: Re: DynaZip no more and 3rd party libraries
- Previous by thread: Re: Language design issue: reference types, or pass-by-reference?
- Next by thread: DynaZip no more and 3rd party libraries
- Index(es):