swarm-support
[Top][All Lists]
Advanced

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

Re: double arguments


From: Paul E. Johnson
Subject: Re: double arguments
Date: Thu, 23 Jul 1998 16:23:24 -0500 (CDT)

Dear Amber:
  I'm curious what you want to pass these doubles for?  You might have
seen notes in this list recently about selectors and you may eventually
bump up against the problem that lots of swarm methods are going to
insist your arguments be of type (id), and not doubles. 

There are some
examples in the manual where (int) is used, and it is OK because its
get cast as id without much trouble.  (see the manual createActionTo:,
for example, where they have this example:

[createActionTo: aTurtle message: $m(move:) : (id)10];

I think the $m is a typo. See they cast 10 as id because selectors 
look for ids as arguments.  But if you want to do something like that
with your function that passes doubles, I expect you will have trouble.

I'm only writing this because most of the time when you work on writing
a selector you are interested in having the swarm system call the code,
and I learned the hard way it won't work.

My notes on that are in the online faq at valinux

On Thu, 23 Jul 1998, Amber L. Hinkle wrote:

>       I was wondering how to call messages with 2 arguments
> 
> I know one is M(test:) : (id)item
> 
> but how do you do two,
>       
>  my function is computeProfit (double) price and: (double)totalcost
> 
> 
> thanks again
> 
> Amber
> 
> 
> 
>                   ==================================
>    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.
>                   ==================================
> 

Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (913) 864-9086
Lawrence, Kansas 66045                FAX: (913) 864-5700


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