passing by refference
Joshua Marshall
joshway_without_spam at myway.com
Thu May 15 15:31:50 EDT 2003
Daniel Fackrell <unlearned at deletethis.learn2think.org> wrote:
...
>> Yes, I agree this is an accurate description of Python. CLU function
>> invocation seems to have call-by-value semantics as well (by my
>> definition and, I believe, the standard definition). And like python,
>> values are object references.
> At the machine level, all that can ever be passed to a
> procedure/function/method/whatever is a value, so in a sense, all languages
> could be considered to be strictly call-by-value.
No, this is not what I was implying. The difference between
call-by-value and other argument-passing schemes is entirely semantic.
For example, the difference between call-by-value and
call-by-reference can be seen by doing an assignment to a formal
parameter. In a call-by-reference world, this can rebind a variable
in your caller's scope, in a call-by-value world, this does not.
Call-by-reference is often implemented by passing a pointer behind the
scenes.
More information about the Python-list
mailing list