experts disagree on "call-by-reference"
Gordon McMillan
gmcm at hypernet.com
Mon Jul 31 16:40:32 EDT 2000
Greg Weeks wrote:
>Lisp, CLU, Java, and Python implement objects, assign objects, and pass
>objects to functions similarly. [Although Jave differs regarding its
>"primitive" types.] So I was curious about how various Lisp, CLU, and
>Java texts dealt with the issue of "references" and "call-by-whatever".
...
Back in '96 or so, I had a knock-down, drag-out fight on c.l.j.? (they call
it a "discussion" there) with a well known Java book author and Sun
employee. He would tell posters "Java is pass by value". I got him to
reform that to: "Java is pass by value: for primitives, it's the value of
the primitive, for references, it's the value of the reference."
I wasn't particularly happy with that either (he should've at least added
"...*not* the referenced object"), but it's technically true, and it should
ring warning bells in the heads of people who have been brainwashed by Herr
Wirth into thinking that "by value" and "by reference" are magical things
the language does for you, without ever stopping to consider how it works.
My experience with these folks is that most of them can grasp what a
pointer is, but less than half ever get "pointer to a pointer".
Pascal-causes-brain-damage-ly y'rs
- Gordon
More information about the Python-list
mailing list