Erlang: Find intersections in a ets table

Posted by Yadira Suazo on Stack Overflow See other posts from Stack Overflow or by Yadira Suazo
Published on 2010-05-08T18:50:12Z Indexed on 2010/05/08 18:58 UTC
Read the original article Hit count: 247

Filed under:
|
|

I have an ets with the next items:

[at, {other_place}, me], [other_place, {place}, {other_place}]], [at, {place}, me], [on, {surface}, {object}], [small, {object}]

And I have the list [[at, door, me],[on, floor, chair],[small, bannanas]]

I need to compare every item in the ets table to an item in the list and if the first one is the same atom, replace the items in round brackets. So if I have [at, door, me], it matches with [at, {other_place}, me], I have to change {other_place} for the atom door in all the ets table.

© Stack Overflow or respective owner

Related posts about erlang

Related posts about ets