copy

skylib_fluffos_v3/mudlib/doc/driver/efuns/general/copy · 537 B

From the archive skylib_fluffos_v3.zip

Download the archive   « Back to the archive contents

.DT
copy
$MUDNAME$ driver help
copy

.SH Name
.SI 5
copy() - recursively duplicate a value
.EI

.SH Synopsis
.SI 5
mixed copy( mixed arg );
.EI

.SH Description
.SP 5 5
copy() returns a value with exactly the same value as `arg', but with
all reference types (mappings, arrays, etc.) duplicated.  For example:
.EP

.SI 5
mapping a, b = ({ 1 });
a = b;
a[0] = 2;
printf("%O %O\n", a, b);

results in ({ 2 }) and ({ 2 }), while:

mapping a, b = ({ 1 });
a = copy(b);
a[0] = 2;
printf("%O %O\n", a, b);

results in ({ 2 }) and ({ 1 }).
.EI

Site Stats

Snippets: 1791
Codebases: 571