swarm-support
[Top][All Lists]
Advanced

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

Re: drop usage for list;


From: Rick Riolo
Subject: Re: drop usage for list;
Date: Mon, 19 Jul 1999 12:52:35 -0400 (EDT)

the distinction you must keep in mind is between
the object (a List in this case) and the variable
which has the address of that object (the list variable
in this case).

When you [list drop], you tell the object which is
pointed to by the list variable to destroy itself,
but you don't modify the contents of the list variable.
so it continues to point to where the object used to be
(until you change the variable contents, eg list=nil;)

Note that the List object pointed to by list
knows nothing about what variables happen to know
its address, so it can't set that variable to nil,
since it doesn't know where that variable is located.

- r

Rick Riolo                           address@hidden
Center for Study of Complex Systems (CSCS)
4477 Randall Lab                
University of Michigan         Ann Arbor MI 48109-1120
Phone: 734 763 3323                  Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html

On Mon, 19 Jul 1999, xueyue wrote:

> Date: Mon, 19 Jul 1999 17:37:38 +0000
> From: xueyue <address@hidden>
> Reply-To: address@hidden
> To: swarm-support <address@hidden>
> Subject: drop usage for list;
> 
> here is a minor problem I met:
> suppose I have a object, x, and:
> [x displayList: list]; 
> will display the content of 'list'. If list=nil, or 
> list has no content, i.e. [list getCount]==0, then 
> -displayList will simply do nothing, otherwise, the 
> members of the list will be displayed.
> The following will work:
> (1) list=[List create: [self getZone]];
>     [x displayList: list];
>      [list drop];
>      list=nil;
>      [x displayList: list];
>      ....
> however, the following will not work:
> (2) list=[List create: [self getZone]];
>     [list drop];
>      [x displayList: list];
>     ......
> 
> The problem seems come from that after [list drop] is 
> executed, list does not exist anymore, and it is not 
> 'nil' either. Is it NULL?


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