Official definition of call-by-value (Re: Finding the instance reference...)

Aaron Brady castironpi at gmail.com
Tue Nov 18 18:03:57 EST 2008


On Nov 18, 2:55 pm, Terry Reedy <tjre... at udel.edu> wrote:
> Steven D'Aprano wrote:
> > On Sun, 16 Nov 2008 15:46:54 -0800, rurpy wrote:
> > For example, consider the two electrons around a helium nucleus. They
> > have the same mass, the same speed, the same spin, the same electric
> > charge, the same magnetic moment, they even have the same location in
> > space (technically, the same wave function).
> > or that white pixels are "nothing" and black pixels are "something".
>
> This is a ridiculous attempt at ridicule;-)  Pixels have positions and 1
> to 4 graded attributes.  Completely different from None.

IINM if I'm not mistaken, portions of the retina are most excited in
the dark.

Same means one of two things.  Either share an identity (continuity of
form), or high degree of similarity in structure and composition.

On a physical level, the electrical states of bit circuits in memory
are very similar in two "equal" bytes.  Low voltage, low voltage, high
voltage.

Outside of the physical, the ideal, there is still such thing as
continuity.  We have a memory:

M= { 0: [ 1, 2 ],
     1: [ 1, 2 ] }

We can write an operation 'app( M, id, val )', which returns the
memory with the entry at id 'id' appended by 'val'.  The bracket
operation ( M[ id ] ) returns the entry of the memory at id 'id'.

>>> app( { 0: [ 1, 2 ], 1: [ 1, 2 ] }, 0, 3 )
{ 0: [ 1, 2, 3 ],
  1: [ 1, 2 ] }
>>> _[ 0 ]
[ 1, 2, 3 ]

Immutable types don't even need it.  Identity serves no additional
purpose to value.  That is, you can pick either tuple ( 1, 2 ), ( 1,
2 ) out of a bag with both in it, and operate.

With side-effects come mutable types, and identity and value diverge.
I think you can make a case that type is an entry in value, leaving
identity and value in general.  Then, identity just means, what
original expression an object is continuous with, and value is the
original expression plus subsequent mutations.

Logical matter can be created and destroyed, which clarifies some of
the issues about composition and identity.

Now go away, before I taunt you a second time.



More information about the Python-list mailing list