Thread overview
Cannot "remove" from associative array
Jun 10, 2005
Patrick Chasco
Re: Cannot
Jun 12, 2005
KUV
Jun 13, 2005
Mike Parker
June 10, 2005
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.


June 11, 2005
"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?


June 12, 2005
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.
June 13, 2005
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.