[DGD]returning copy() of arrays, objects
Kris Van Hees
aedil at alchar.org
Mon Jan 31 03:53:21 CET 2000
> I don't know why you simply wouldn't use call_another_func(foo[..])
> though, unless you don't know what type of variable you're using in the
> calling function. If you're dealing with mixed, the copy function would
> come in handy.
Note though that the copy function as it was given by the original poster
is doing nothing more than a single level copy, rather than a deep copy.
So if you have an array of arrays, making a copy will indeed yield a new
array, but it will still contain references to the original deeper arrays,
and so those could be modified.
Most DGD mudlibs I've seen have fixed that adequately with pretty trivial
code.
Kris
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list