[erlang-questions] match_delete and fun2ms

Chandru <>
Mon Mar 22 06:56:31 CET 2010


On 20 March 2010 20:41, Max Lapshin <> wrote:

> Is it possible to delete entries from ets, basing on fun2ms spec?
>
>
> Spec = ets:fun2ms(fun(#video_frame{dts = TS} ) when TS < Limit ->
>   true
> end),
> Count = ets:select_count(Frames, Spec),
> ets:match_delete(Frames, Spec)
>
> This code shows me increasing Count, but doesn't delete anything.
>

Did you mean to write ets:select_delete(Frames, Spec) instead of
match_delete?

cheers
Chandru


More information about the erlang-questions mailing list