[erlang-questions] Strange behaviour of ets
Andreas Hillqvist
andreas.hillqvist@REDACTED
Wed Feb 27 13:37:23 CET 2008
It looks to me like you use the key as the table name.
Maybe somthin like this:
ie@REDACTED)94> ets:select(test, [{{{qwe, '$2'}, '$3'}, [], ['$3']}]).
Kind regards
Andreas Hillqvist
2008/2/27, Maxim Treskin <zerthurd@REDACTED>:
> Hello
>
> I see some strange behaviour of ets interaction.
> After I did an error in ets:select request, all following requests are
> erroneous until, i.e. ets:new
> It is my session:
>
> --------------------------
> (ie@REDACTED)89> ets:new(test, [public, named_table]).
> test
> (ie@REDACTED)90> ets:insert(test, {{as, 2}, 23}).
> true
> (ie@REDACTED)91> ets:insert(test, {{qwe, 5}, 756}).
> true
> (ie@REDACTED)92> ets:insert(test, {{xcv, 3}, 111}).
>
true
> (ie@REDACTED)93> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
> [111,756,23]
> (ie@REDACTED)94>
>
> All is OK
>
> (ie@REDACTED)94> ets:select(qwe, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
>
** exception error: bad argument
> in function ets:select/2
> called as ets:select(qwe,[{{{'$1','$2'},'$3'},[],['$3']}])
>
> Error
>
> (ie@REDACTED)95> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
>
** exception error: bad argument
> in function ets:select/2
> called as
> ets:select(test,[{{{'$1','$2'},'$3'},[],['$3']}])
>
> The same request as in 93 line, error also
>
>
> --------------------------
>
> Why this error happens?
>
>
> Thank you
>
> --
> Maxim Treskin
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list