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.
>
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
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
Lew schreef:
> Roel Schroeven wrote:
>> Laurent Pointal schreef:
>>> Summercool a écrit :
>>>> The meaning of a = b in object oriented languages.
>>>>
>>>
>>>
>>>
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]; }
>
"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
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
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]
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
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
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
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
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
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
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.
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
16 matches
Mail list logo