www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cannot "remove" from associative array

reply Patrick Chasco <patrick chascosoft.com> writes:
Hello

I am getting what seems to me to be a strange error when trying to remove an
element from an associative array.

The error:
noba\scene.d(46): undefined identifier remove
noba\scene.d(46): function expected before (), not remove of type int

The relevant code:

typedef int OBJECTID;

class ObjectBase
{
public void removeChild(ObjectBase o) 
{
children.remove(o.id);
}

public:
ObjectBase[OBJECTID] children;
OBJECTID id;
}

Thanks in advance.
Jun 10 2005
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Patrick Chasco" <patrick chascosoft.com> wrote in message 
news:d8cse9$1rgu$1 digitaldaemon.com...
 typedef int OBJECTID;

 class ObjectBase
 {
 public void removeChild(ObjectBase o)
 {
 children.remove(o.id);
 }

 public:
 ObjectBase[OBJECTID] children;
 OBJECTID id;
 }

Works fine for me. Maybe you botched your upgrade to 0.126?
Jun 10 2005
parent reply KUV <KUV_member pathlink.com> writes:
In article <d8dck3$2c58$1 digitaldaemon.com>, Jarrett Billingsley says...
"Patrick Chasco" <patrick chascosoft.com> wrote in message 
news:d8cse9$1rgu$1 digitaldaemon.com...
 typedef int OBJECTID;

 class ObjectBase
 {
 public void removeChild(ObjectBase o)
 {
 children.remove(o.id);
 }

 public:
 ObjectBase[OBJECTID] children;
 OBJECTID id;
 }

Works fine for me. Maybe you botched your upgrade to 0.126?

I had same bug with version 0.125. Upgrade to 0.126 solved it.
Jun 12 2005
parent Mike Parker <aldacron71 yahoo.com> writes:
KUV wrote:

 I had same bug with version 0.125.
 Upgrade to 0.126 solved it.

It's not a bug. remove() was added to aa's in 0.126, and did not exist in previous versions.
Jun 12 2005