Using ets:match outside of ets?

Shawn Pearce <>
Tue Mar 4 09:58:29 CET 2003


Doh!  I remember seeing that function 2 days ago.  :)

These darn docs cover so much stuff!

Thanks, I'll try ets:test_ms/2, it does look like it would
work for me.


Pierpaolo BERNARDI <> wrote:
> From: "Shawn Pearce" <>
> 
> > I basically need to do something like:
> > 
> > M = #some_rec{f1=Type,f2=Y,_='_'}, % MatchSpec as per ets:match
> > P = #some_rec{...}, % object to test
> > case match(M, P) of
> > true ->
> > % good;
> > false ->
> > % bad;
> > end.
> > 
> > ideas?
> 
> the function ets:test_ms/2 does *almost* exactly what you want.
> Perhaps you can adapt your code to use it.
> 
> P.
> 

-- 
Shawn.

  The only way to keep your health is to eat what you don't want, drink what
  you don't like, and do what you'd rather not.
  		-- Mark Twain



More information about the erlang-questions mailing list