swarm-support
[Top][All Lists]
Advanced

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

Re: star * * * ....


From: Rick Riolo
Subject: Re: star * * * ....
Date: Mon, 1 Dec 1997 07:36:33 -0500 (EST)

The *'s  mean the same thing in Swarm (ie in objectiveC)  as they do in C.   
Recall, objectiveC is just a superset of C, with a very few additions to the 
langange.   
Thus as you surmised, one star means a pointer to a variable; two stars 
just means a pointer to a pointer to a variable.

You may be confused by the spacing in the examples you show.
Those could be written:
   HeatbugModelSwarm *heatbugModelSwarm;
   main(int argc, char **argv)
which I find makes the meaning more clear, but 
that is a programming style choice,
which is, of course, just style (with most or all that implies!).

The former says the heatbugModelSwarm variable is a pointer to a
HeatbugModelSwarm object.   One convention (ie not requried regularity) 
you will see in these examples is that variables start in lower case, and 
have subsequent run-on words start with uppercase letters.
Class names start uppercase, and similarly have uppercase-starting words.

I believe the Swarm online docs have a page about Swarm and objectiveC
conventions, as well as a pointer to the online objectiveC manual.

The **argv is the starndard convention for handling run-time parameters 
through the main entry point to all C programs...any C intro will 
explain that.

 - r

Rick Riolo                           address@hidden
Program for Study of Complex Systems (PSCS)
4068 Randall Lab                
University of Michigan         Ann Arbor MI 48109-1120
Phone: 313 763 3323                  Fax: 313 763 9267
http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html
http://pscs.physics.lsa.umich.edu//pscs.html

On Mon, 1 Dec 1997, RHS Linux User wrote:

> Date: Mon, 1 Dec 1997 11:42:27 GMT
> From: RHS Linux User <address@hidden>
> To: address@hidden
> Subject: star * * * ....
> 
> I have problems in understanding the "*" signs in swarm programs, are 
> those related with Smalltalk, or something else. I only know in 
> C, * will be used to indicate a variable is a pointer, but what about
> these:
> 
> (from HeatBugs application)
> HeatbugModelSwarm * heatbugModelSwarm
> Xcolormap * colormap
> main(int argc, char ** argv)
> -drawSelfOn: (Raster *) r;
> 
> Would anyone please explain the * and ** here, and if possible point me
> a reference about the SWARM usage conventions?
> 
> Many Thanks!
> 
>                   ==================================
>    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.
>                   ==================================
> 

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