Re: The meaning of a = b in object oriented languages

2007-09-20 Thread John W. Kennedy
Russell Wallace wrote: > Summercool wrote: >> so most or all object oriented language do assignment by reference? >> is there any object oriented language actually do assignment by >> value? I kind of remember in C++, if you do >> >> Animal a, b; >> >> a = b will actually be assignment by value. >

Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Lew
Lew wrote: >> Java is a strongly-typed, compiled language which means it does more >> static type checking and thus would reject treating a as both an array >> and a String. >> In that environment the programmer must choose one or the other. Ken Bloom wrote: > In this Java example, a and b are s

Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Ken Bloom
On Tue, 18 Sep 2007 18:02:59 -0400, Lew wrote: > Summercool wrote: >> when a writing or a book reads "a is a Hash object; a is an Array >> object; or a is an Animal object" it is just a short form to say that >> "a is a reference to that object." >> >> b = a means "whatever a is referencing to, n

Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Roel Schroeven
Lew schreef: > Roel Schroeven wrote: >> Laurent Pointal schreef: >>> Summercool a écrit : >>>> The meaning of a = b in object oriented languages. >>>> >>> >>> >>>

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Bryan Olson
Jim Langston wrote: > Assignment operators in C++ should attempt to prevent two pointers poining > to the same memory location. Consier a simple class (untested): > > class Foo > { > public: >char* Data; >int DataSize; >Foo( int Size ): DataSize( Size ) { Data = new char[Size]; } >

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Terry Reedy
"Summercool" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] In Python, names are names. They get associated with or bound to objects. b= means associate name b with the object resulting from evaulating the expression. So b = a means associate b with the object 'currently' bou

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Lew
Roel Schroeven wrote: > Laurent Pointal schreef: >> Summercool a écrit : >>> >>> The meaning of a = b in object oriented languages. >>> >> >> >> Oups, reading the subject I thought it was

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Lew
Summercool wrote: > when a writing or a book reads "a is a Hash object; a is an Array > object; or a is an Animal object" it is just a short form to say that > "a is a reference to that object." > > b = a means "whatever a is referencing to, now b is referencing it > too". > > so that's why a[1]

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Laurent Pointal <[EMAIL PROTECTED]> wrote: >Summercool a écrit : >> >> The meaning of a = b in object oriented languages. >> > > >Oups, reading the subject I tho

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Roel Schroeven
Laurent Pointal schreef: > Summercool a écrit : >> >> The meaning of a = b in object oriented languages. >> > > > Oups, reading the subject I thought it was a Xah Lee post. me too ... -- The saddest as

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Laurent Pointal
Summercool a écrit : > > > The meaning of a = b in object oriented languages. > Oups, reading the subject I thought it was a Xah Lee post. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Gabriel Genellina
En Tue, 18 Sep 2007 03:57:36 -0300, Summercool <[EMAIL PROTECTED]> escribi�: > i think the line > > a = "different" > > means a is now set to a pointer to the String object with content > "different". > or that "a is now a reference to the String object." > > and b is still a reference to the Ar

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Summercool
On Sep 17, 11:04 pm, Lloyd Linklater <[EMAIL PROTECTED]> wrote: > SpringFlowers AutumnMoon wrote: > > Is that the case: if a is an object, then b = a is only copying the > > reference? > > That and it adds a counter. > > a = ["foo", "bar"] > b = a > b[0] = "bite me" > p a, b > > a = "different" > p

Re: The meaning of a = b in object oriented languages

2007-09-17 Thread Ben Finney
Summercool <[EMAIL PROTECTED]> writes: > I just want to confirm that in OOP, if a is an object, then b = a is > only copying the reference. Whether the language is OO or not has no bearing on this question. The semantics of the assignment operator can and do differ between languages, orthogonal t

Re: The meaning of a = b in object oriented languages

2007-09-17 Thread Russell Wallace
Summercool wrote: > so most or all object oriented language do assignment by reference? > is there any object oriented language actually do assignment by > value? I kind of remember in C++, if you do > > Animal a, b; > > a = b will actually be assignment by value. > while in Java, Python, and Ru

The meaning of a = b in object oriented languages

2007-09-17 Thread Summercool
The meaning of a = b in object oriented languages. I just want to confirm that in OOP, if a is an object, then b = a is only copying the reference. (to make it to the most basic form: a is 4 bytes, let's say, at memory loc