gb_trees, strange behaviour

Michal D. michal.dobrogost@REDACTED
Fri Nov 5 17:47:08 CET 2010


Hi again,

I'm having a lot of problems starting out with Erlang. It appears to me that
I can't update a specific key of a gb_tree, while the other ones work fine.
Can anyone explain the following behaviour?

> X = gb_trees:from_orddict([{trace,false},{limit,-1},{timeout,-1}]).
{3,{limit,-1,{trace,false,nil,nil},{timeout,-1,nil,nil}}}
>
> gb_trees:update(limit,true,X).
{3,{limit,true,{trace,false,nil,nil},{timeout,-1,nil,nil}}}
>
> gb_trees:update(timeout,true,X).
{3,{limit,-1,{trace,false,nil,nil},{timeout,true,nil,nil}}}
>
> gb_trees:update(trace,true,X).
** exception error: no function clause matching
                    gb_trees:update_1(trace,true,nil)
     in function  gb_trees:update_1/3
     in call from gb_trees:update/3
>

Thanks!


More information about the erlang-questions mailing list