[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-user
Subject:    Re: [Gambas-user] An other OO problem.
From:       "Jussi Lahtinen" <jussi.lahtinen () gmail ! com>
Date:       2009-01-20 16:35:29
Message-ID: 384d3900901200835q6fd4cc5dmb65dc3da3940b30 () mail ! gmail ! com
[Download RAW message or body]

Ok, I get what you mean.
There are two copies of the array (two objects), but their content points
to same objects. So result only looks kind of shallow copy.
Brain twisting... warning to documentation would be nice.


Jussi


On Tue, Jan 20, 2009 at 5:43 PM, Rob <sourceforge-raindog2@kudla.org> wrote:
> On Tuesday 20 January 2009 10:13, Jussi Lahtinen wrote:
>> Maybe something like "Returns a copy of the array of object references."
>> ? I'm really NOT expert of this topic! I understand that result as
>> shallow copy, as the way that wikipedia describe it (
>> http://en.wikipedia.org/wiki/Object_copy ).
>
> Actually, given the definitions there, what Gambas is doing is a deep copy.
>
> In a shallow copy, there's only one object (array, in this case) when the
> copy is complete, and two references to it (and the originally declared
> second array's allocated memory is lost to either garbage collection or a
> memory leak), but in a deep copy, there are two independent copies of the
> array when you're done.  In Gambas the latter is true.
>
> Rob
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic