Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  ets:match/1 and ets:select/1

Guest
Posted: Wed Aug 29, 2007 9:40 pm Reply with quote
Guest
Problem with ets:match(continuation);
same problem with ets:select(continuation).

match/1, and select/1 only work with variables.

-- doug edmunds
I posted this yesterday, but it never showed up
and is not in the archives. Sorry if you receive
this twice.

29 August 2007


Example of bug:
%set up an ets table
A = ets:new(arf,[bag]),
ets:insert(A,[{frog,croak}, {duck,quack},
{cow, moo}, {dog, bark}, {dog,pluto}, {dog,tails},
{ dog,woof},{cat, meow},
{pig,oink},{chicken, cluck},
{rooster, cockadoodle}]).

%match/3
{D, E } = ets:match (A,{'$1','$2'},3 ).

E.
%% {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}

E == {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}.
%% true.

E =:= {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}.
%% true.

%continuation that works:
ets:match(E).
% {[[cow,moo],[dog,bark],[dog,pluto]],{15,132,3,<<>>,[],0}}

%bug: continuation that fails:
ets:match({15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}).

produces this error report:

=ERROR REPORT==== 28-Aug-2007::07:33:08 ===
Error in process <0.30.0 > with exit value: {badarg,[{ets,match,[{15,103,3,<<0 by
tes>>,[[dog,bark],[dog,pluto]],2}]},{erl_eval,do_apply,5},{shell,exprs,6},{shell
,eval_loop,3}]}

** exited: {badarg,[{ets,match,[{15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}]},

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum