Finding the instance reference of an object

Douglas Alan doug at alum.mit.edu
Fri Nov 7 19:52:23 EST 2008


Joe Strout <joe at strout.net> writes:

> Yes, OK, that's great.  But there are several standard pass-by-
> somethings that are defined by the CS community, and which are simple
> and clear and apply to a wide variety of languages.  "Pass by object"
> isn't one of them.

"Call-by-sharing" *is* one of them, and the term has been around since
the 70s:

   http://hopl.murdoch.edu.au/showlanguage.prx?exp=637

> I guess if you want to campaign for it as a shorthand for "object
> reference passed by value," you could do that, and it's not
> outrageous.

There's no need for a campaign.  The term has already been used in the
academic literature for 34 years.

> But to anybody new to the term, you should explain it as exactly
> that, rather than try to claim that Python is somehow different from
> other OOP languages where everybody calls it simply pass by value.

It's not true that "everybody calls it simply pass by value".

> OK, if there were such a thing as "pass-by-object" in the standard
> lexicon of evaluation strategies, I would be perfectly happy saying
> that a system has it if it behaves as though it has it, regardless of
> the underpinnings.

There is "call-by-sharing" in the standard lexicon of evaluation
strategies, and it's been in the lexicon since 1974.

> However, if you really think the term is that handy, and we want to
> agree to say "Python uses pass by object" and answer the inevitable
> "huh?" question with "that's shorthand for object references passed by
> value," then I'd be OK with that.

Excellent.  We can all agree to get along then!

|>oug



More information about the Python-list mailing list