passing by refference
Joshua Marshall
joshway_without_spam at myway.com
Tue May 13 16:27:24 EDT 2003
Aahz <aahz at pythoncraft.com> wrote:
> In article <b9rfpa$n45$1 at ginger.mathworks.com>,
> Joshua Marshall <joshway_without_spam at myway.com> wrote:
>>
>>What you describe is call-by-value. There is an implicit copy of the
>>arguments passed to a function, though not a deep-copy. The values
>>that are being copied are often references.
> Depends whether you consider the arguments to be the binding contained by
> a target or the object being passed in by the binding;
I'm not sure what you mean by "binding contained by a target". A
binding is a pair: a variable and a value.
> if the latter, you're wrong.
I do mean that the arguments are objects. If you feel I'm wrong, it's
because we disagree about terminology. Though I've come to see that
meanings of "call-by-value" and "call-by-reference" used in c.l.py are
often non-standard.
> More than that, you're completely wrong about "often
> references"; what gets passed in to a function parameter is *always* a
> binding.
I'm not sure in what way you mean I'm wrong here. If you mean I
should have said "always references" instead of "often references", I
won't quibble.
> Note that I'm using "binding" instead of "reference"; like the mistaken
> use of "call-by-value", "reference" has semantics that make sense in
> other languages, but not in Python.
I believe it makes sense in Python (call-by-value), though I agree the
term "reference" might be misleading.
More information about the Python-list
mailing list