MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: [WISH LIST] Multple verb calls.. (read on)



Some Dude wrote:
> 
> I dunno if this would even be possible, but what I'm thinking is this:
> 
> Let's say you have a list of objnmums.  And you need to call a verb from
> each object.
> Just for the sake of this message, we'll say it's {#99,#100,#101}.
> Now, instead of sayin:
> 
> for x in ({#99,#100,#101})
>   x:tell("Whatever.");
> endfor
> 
> What if all we had to do was say:
> 
> {#99,#101,#100}:tell("Whatever.");
> 
> And the server would automatically read it like the first example?
> Just a thought..?

Have a look at $list_utils:map_verb() in Lambdacore.

$list_utils:map_verb({#99,#101,#100},"tell","Whatever.");

If the verb returns a result, then :map_verb() returns a list of the
results from each verb call.

It also has :map_prop() and :map_arg() which do other similar multiobject
things.


Follow-Ups: References:

Home | Subject Index | Thread Index