[DGD] Referencing an array of variable depth
Steve Foley
zeppo1 at mindspring.com
Mon Mar 1 23:10:18 CET 2004
"Robert Forshaw" <iouswuoibev at hotmail.com> wrote:
> Imagine a situation where you have an array of arrays, and the first element
> of each array may contain another array of arrays. At some point you want to
> change a value of all the arrays.
You could use a (non-lightweight) object to represent the action queue.
The action queues for these objects might also contain other instances of action
queues. The action queues then become pretty easy to export references to and
maintain them in other objects. You can then write whatever methods you're
going to need to manipulate the queue in the queue itself and have code designed
to propagate that change to all the action queues 'in' this particular queue.
I'm not sure if you could get away with using an LWO instead. Obviously, you
can't export references without them being copied at the end of the thread, so
that's one limitation with using a LWO. But if you can live without exporting
references (and all the other limitations) then an LWO might be a better
solution than using a 'real' object.
The one problem with the above solution might be stack depth. If you have a
bunch of nested queues, you might run out of stack depth if the nest is deep
enough.
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list