[DGD] Clones and very large arrays

Bart van Leeuwen bart at wotf.org
Mon Apr 5 21:01:29 CEST 2004



On Mon, 5 Apr 2004, Michael McKiel wrote:

>  --- Bart van Leeuwen <bart at wotf.org> wrote:
> >
> > > Then, it is quite nice to be able to do something like
> > > query_clones(obj)->function(args);
> >
> > Ah yes.. that is indeed what I do. Forgot that calling a function in an
> > array like that is one of my mods to the kernel (its somethign I really
> > like, even if it is 'syntactic sugar' and could be replaced by a
> > call_array like construct)
> >
>
> That appears to me to seemingly do partial lamba functions does it not? Which
> was discussed quite a bit in the archives being able to call a function with
> variable args on every element of an array.

Hmm, this does no more then looping through the array og objects and call
the same function with the same arguments in all of them..

Of course, when the argument is an array, mapping or object, you can do
some funny things since it can be changed on the fly..

so.. its equivalent to for(i=0; i<sizeof(a); i++) { a[i]->f(args); }

So I'd say.. this is calling a function with the same args on every
element of an array...

Nothing fancy (and wasn't the reason for masking call_other, its just nice
to have and since I already masked call_other, a simple thing to add)

Bart

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list