[Gambas-user] An other OO problem.

Jussi Lahtinen jussi.lahtinen at ...626...
Tue Jan 20 17:35:29 CET 2009


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 at ...94...> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list