What other languages use the same data model as Python?

Grant Edwards invalid at invalid.invalid
Thu May 5 12:56:01 EDT 2011


On 2011-05-05, Roy Smith <roy at panix.com> wrote:
> In article <ipubhb$e4q$2 at reader1.panix.com>,
>  Grant Edwards <invalid at invalid.invalid> wrote:
>
>> That's what I was trying to say, but probably not as clearly.  The "&"
>> operatore returnas a _value_ that the OP passes _by_value_ to a
>> function.  That function then uses the "*" operator to use that value
>> to access some data.
>
> Then, of course, there's references in C++.  I think it's fair to call 
> the following "call by reference" in the sense we're talking about it 
> here.
>
> void f(int& i) {
>    i = 5;
> }
> int i = 42;
> f(i);

If after the call to f(i) the caller sees that i == 5, then that's
call by reference.  But, we were talking about C.

> Of course, C++ lets you go off the deep end with abominations like 
> references to pointers.  Come to think of it, C++ let's you go off
> the deep end in so many ways...

:)

-- 
Grant Edwards               grant.b.edwards        Yow! Is this sexual
                                  at               intercourse yet??  Is it,
                              gmail.com            huh, is it??



More information about the Python-list mailing list