blob: 39f3752f92571054880483dbfd8f948fca5aa62d [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 mixed copy(mixed arg);
3
4BESCHREIBUNG
5 Erzeugt eine flache Kopie von <arg> und liefert diese zurueck. Fuer
6 Arrays und Mappings heisst das, dass neue Arrays bzw. Mappings erzeugt
7 werden, die Kopien der Elemente des Originals enthalten. Eingebettete
8 Arrays und Mappings werden jedoch als Referenz uebergeben!
9
10 Fuer andere Werte von <arg> bewirkt diese Funktion nichts.
11
12BEISPIEL
13 mixed *a, *b;
14 a = ({ 1, ({ 21, 22 }) });
15 b = copy(a);
16 a[0] = -1; a[1][0] = -21;
17 --> a ist nun ({ -1, ({ -21, 22 }) })
18 b ist nun ({ 1, ({ -21, 22 }) })
19
20SIEHE AUCH
21 deep_copy(E)
22
2310.Apr.2007 Gloinson