Dokumentation zu: copy(E)

HR Image


SYNOPSIS
        mixed copy(mixed arg)

DESCRIPTION
        Create a shallow copy of <arg> and return it. For arrays and mappings
        this means that a new array or mapping is created with copies of the
        original content. Embedded arrays and mappings are copied by reference!

        For other values this function is a no-op.

EXAMPLES
        mixed *a, *b;

        a = ({ 1, ({ 21, 22 }) });
        b = copy(a);
        a[0] = -1; a[1][0] = -21;
         --> a is now ({ -1, ({ -21, 22 }) })
             b is now ({  1, ({ -21, 22 }) })

HISTORY
        Introduced in LDMud 3.2.6.

SEE ALSO
        deep_copy(E)

Die Seite ist auch in Deutsch vorhanden.

Start » Magierhandbuch » Docu » Efun » Copy Letzte Generierung: 25.04.2021, 01:58
Email an: mud@wl.mud.de
Valid HTML 4.01!