swarm-support
[Top][All Lists]
Advanced

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

Re: Line graph selector with arguments


From: Marcus G. Daniels
Subject: Re: Line graph selector with arguments
Date: Fri, 9 Apr 1999 21:32:12 -0600 (MDT)

LM> For the selector passed to
LM> 'andSelector', is there a way to pass an argument to the
LM> selector (without changing the Swarm source)?

Sorry, no.  Probably the easiest thing to do is munge the object:

  int i;

  for (i = 0; i < 10; i++) 
    {
      [self setIntVar: i];
      [resultGraph createSequence: buf
                     withFeedFrom: self 
                      andSelector: M(getTime)];
     }

Where -getTime looks at what -setIntVar: sets. 

Btw, the next release of Swarm will have an feature for creating closures.

This feature will facilitate the implementation of an andClosure:
variant method.  The usage would be something like this:
 
  int i;
  id fa = [[[FArguments createBegin: aZone] addInt: &i] createEnd];
  id fc = [[[FCall createBegin: aZone]
            setArguments: fa]
            setMethod: M(getTime:) inObject: self];
 
  for (i = 0; i < 10; i++)
    [resultGraph createSequence: buf withFeedFrom: self andClosure: fc];

Nifty or deranged?  You decide...

                  ==================================
   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]