swarm-support
[Top][All Lists]
Advanced

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

Re: Swarm coding question: M( x ) only accepts id returns?


From: Sven N. Thommesen
Subject: Re: Swarm coding question: M( x ) only accepts id returns?
Date: Tue, 04 Nov 1997 11:27:35 -0600

At 05:10 PM 11/3/97 -0600, you wrote:
>
>
>I have a method that returns an integer and takes 4 arguments.
>
>Calls like this work fine:
> 
>      [aVoter report: 10 W:15 Y:20 Z:100];
>
>However, I'm trying to make the SWARM modelactions regime function, so I
>try:
>
>[modelActions createActionForEach: voterList    message: M(report: 1 W:1
>Y: 50 Z: 50)];
>
>This causes the compiler to fail.  Error:
>
>ModelSwarm.m:89: parse error before `1'
>

Paul,

the documentation for ActionGroup suggests the following syntax:
-createActionForEach: target message: (SEL)aSel :arg1 :arg2 :arg3;

In your case, that would be:

[modelActions createActionsForEach: voterList
   message: M(report:W:Y:Z:) :1 :1 :50 :50];

In other words, the first argument to 'message:' is your selector, without
arguments, and subsequent arguments are the arguments to your selector.
Just a little confusing the first time you do it ;-)

Unfortunately, they only implemented this method for selectors that take a
maximum of 3 arguments. You'd need to fix the source, or bug Glen to do it
for you, to get more than that :-(

Cheers,
Sven

PS: thanks to the references to window managers -- I couldn't acces your
pages because the web seems like molasses today, but I will go there when I
can.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]