[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object copy function question


Le 06/09/2024 à 00:13, Bruce Steers a écrit :
A method like CopyData or CopyNew or CopyContents or some other relevant word that copies an array contents as an actual copy without referencing would be awesome. The Word Copy kinda misleads to think  you will get a true copy of the data instead of references. I've had to recursively copy arrays within arrays in some code to overcome the referencing.
Just a thought 😊


There is no "false" or "true" copy method, but "shallow" and "deep" copy.

You can't have a deep copy method of an array (or collection) contents in Gambas, as there is no standard way for the interpreter to know how to copy an object.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: Object copy function questionFabien Bodard <gambas.fr@xxxxxxxxx>
References:
Object copy function questionLinus <olivier.cruilles@xxxxxxxx>
Re: Object copy function questionBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: Object copy function questionBruce Steers <bsteers4@xxxxxxxxx>