Is 'everything' a refrence or isn't it?

M

Max

Terry said:
From what I can tell, Liskov proposed *three* different
names for
passing references to objects: call-by-sharing,
call-by-object, and call-by-object-reference.


"Call by object reference" makes the most sense to me. Names
in Python are object references: they refer to objects. You
might almost say "call by name" but that sort of implies
that you are passing the strings around (which is generally
untrue), and it doesn't convey what happens when the name is
something complex like "ham['spam'][0].eggs()[42]" (i.e.
"name" carries the conotation of being a simple string,
although you could argue that it doesn't have to mean that).

Except that what is passed is not "ham['spam'][0].eggs()[42]" -
that's the *name of where one copy of the objects name is*. The
name is ham['spam'][0].eggs()[42].id() - usually something like
0xBEEFBABE.

When I fill in a form (say if I applied for a visa) - three
things could happen:

a) Pass by object reference/name: I write "8x0323xxxxxx081" (my
ID number) or "Max Xxxxx Rabkin" (my name) on the form, so they
know who I am.

b) Your method (pass by container reference?): I write
"The youngest male living at:
32 Xyz Road
Rondebosch
Cape Town".
They know who I am, until I move house or I get a baby brother.

c) Pass by value: I staple myself to the form. Painful, but
it works. Unless I need a vaccination for the visa. Then I have
to make a copy of myself; one copy gets vaccinated while the
other is getting the visa. Unfortunately, I still can't get
into Italy, because the guy with the visa doesn't have a
vaccination and vice versa.

--Max
 
R

rurpy

Steve Holden wrote:
[...snipped a long and very helpful post addressing some
questions I had regarding the nature of an object's value
in python...]

Sorry for the belated reply Steve (I had some access
problems) but did want to let you know I found that post
very informative, and wanted to thank you for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top