[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
removing an object from list
From: |
glen e. p. ropella |
Subject: |
removing an object from list |
Date: |
Wed, 26 Feb 1997 08:51:23 -0700 |
Jae Chan Oh writes:
> Hi,
> In my simulation, I need to remove an arbitrary object from a list.
> The list is basically the same as pplList in hello-world/v03.
>
> Currently, I'm trying to send remove message to pplList in "step" method
> in Person.m.
> i.e. something like: [pplPresent remove: self]; is done.
>
> where pplPresent is just another head to the list pplList.
>
> But:
> First, I'm not quite sure that this is the correct way to call remove nor
> I'm not it is the best way. I think calling remove from pplModelSwarm.m
> would make things complicated since I would have traverse the list.
>
> Currently, I'm getting "core dump" on the above call to the list.
This is a known problem. Please see:
http://www.santafe.edu/projects/swarm/archive/list-archive.9610/0074.html
This is a basic tutorial on how to remove objects from the world.
Hope this helps.
glen