Cloning objects

From Liberty Eiffel Wiki
Revision as of 20:56, 16 April 2016 by Ramack (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
*** TO DO ***
add this page, maybe there is already some useful content in the french version of the SmartEiffel Wiki.
* rename this page to "duplicating objects"?
* twin, copy
* main property: is_equal afterwards
* make, COLLECTION.from_collection (e. g. make an ARRAY from another type of collection)
<ramack> copy is a feature which is inherited from ANY - so EVERY class (and therefore every object) has it and it does the same everywhere: the object on which it is called (the thing before the dot) copies the content of the parameter of the call
<ramack> in case of an ARRAY2 this of course also applies to lower/upper12...
<ramack> the main property of copy is that: a.copy(b).is_equal(b) holds
<Petroo> makes sense
<ramack> I. e. after copying from an object it is equal!