Problem with ets:match(continuation);<br>same problem with ets:select(continuation).<br><br>match/1, and select/1 only work with variables.<br><br>-- doug edmunds<br>I posted this yesterday, but it never showed up<br>and is not in the archives. Sorry if you receive
<br>this twice.<br><br>29 August 2007<br><br><br>Example of bug:<br>%set up an ets table<br>A = ets:new(arf,[bag]),<br>ets:insert(A,[{frog,croak}, {duck,quack},<br>{cow, moo}, {dog, bark}, {dog,pluto}, {dog,tails},<br>{ dog,woof},{cat, meow},
<br>{pig,oink},{chicken, cluck},<br>{rooster, cockadoodle}]).<br><br>%match/3<br>{D, E } = ets:match (A,{'$1','$2'},3 ).<br><br>E.<br>%% {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}<br><br>E == {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}.
<br>%% true.<br><br>E =:= {15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}.<br>%% true.<br><br>%continuation that works:<br>ets:match(E).<br>% {[[cow,moo],[dog,bark],[dog,pluto]],{15,132,3,<<>>,[],0}}<br>
<br>%bug: continuation that fails:<br>ets:match({15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}).<br><br>produces this error report:<br><br>=ERROR REPORT==== 28-Aug-2007::07:33:08 ===<br>Error in process <0.30.0
> with exit value: {badarg,[{ets,match,[{15,103,3,<<0 by<br>tes>>,[[dog,bark],[dog,pluto]],2}]},{erl_eval,do_apply,5},{shell,exprs,6},{shell<br>,eval_loop,3}]}<br><br>** exited: {badarg,[{ets,match,[{15,103,3,<<>>,[[dog,bark],[dog,pluto]],2}]},
<br>                    {erl_eval,do_apply,5},<br>                    {shell,exprs,6},<br>                    {shell,eval_loop,3}]} **<br><br><br><br>