passing by refference

Daniel Fackrell unlearned at DELETETHIS.learn2think.org
Thu May 15 15:06:47 EDT 2003


"Joshua Marshall" <joshway_without_spam at myway.com> wrote in message
news:ba0hrt$495$2 at ginger.mathworks.com...
> Fredrik Lundh <fredrik at pythonware.com> wrote:
> ...
> > did you read reference 1?
>
> >     http://www.cs.berkeley.edu/~jcondit/pl-prelim/liskov77clu.pdf
>
> <snip>
>
> > replace "CLU" with "Python", "record" with "instance", and "procedure"
> > with "function or method", and you get a pretty accurate description
> > of Python's object model.
>
> > if you don't agree, please tell us what Python does differently.  be
very
> > specific.
>
> 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.

However, using such a line of thought causes call-by-value to lose all
meaning, as you can no longer distinguish between the methodologies by which
the passed items are used.

It is one thing to use the value directly, another to treat the value as a
pointer to another value, yet another to treat it as a pointer to some
complex structure, and another to treat it as a pointer to an object.

So while you can be considered to be correct in one sense, I don't see that
such correctness lends itself very well to usefulness.

--
Daniel Fackrell (newsgroups.NOSPAM at dfackrell.mailshell.com)
When we attempt the impossible, we can experience true growth.






More information about the Python-list mailing list