What other languages use the same data model as Python?
Ian Kelly
ian.g.kelly at gmail.com
Wed May 4 18:22:42 EDT 2011
On Wed, May 4, 2011 at 3:35 PM, harrismh777 <harrismh777 at charter.net> wrote:
> Grant Edwards wrote:
>>>
>>> We do not consider passing a pointer as*by value* because its an
>>> > address; by definition, that is pass-by-reference.
>>
>> No, it isn't. It's pass by value. The fact that you are passing a
>> value that is a pointer to another value is not relevent.
>>
>
> @ Edwards, &Schaathun
>
> You are most definitely mistaken. See:
>
> http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr233.htm
That source actually supports the claim that pass-by-pointer falls
under pass-by-value. It reads, in part (emphasis added):
> In C++, the reference parameters are initialized with the actual arguments when the function is called. In C, the pointer parameters > are initialized with pointer _values_ when the function is called.
However, I hope we can all agree that pass-by-pointer shares certain
features with both pass-by-value and pass-by-reference, and there are
perfectly reasonable arguments for lumping it in either category, yes?
More information about the Python-list
mailing list