Something like a Map with patterns as keys

ok this would look like that right:

a = fn({a,b,c}) when a==1 and b==2 -> c end
b = fn({a,b,c}) when a==2 and b==3 -> c end
table = :ets.new(:table, [:set, :protected])
ms = :ets.fun2ms(a)++:ets.fun2ms(b)
:ets.insert(table, { :ets.fun2ms(a), a})
:ets.insert(table, { :ets.fun2ms(b), b})
:erlang.match_spec_test({1,2,3}, ms, :table) # ok 
:erlang.match_spec_test({2,3,10}, ms, :table) # ok
:erlang.match_spec_test({1,3,2}, ms, :table) # doesn't match

What irritates me about this solution is (1) that I have to two things to take care of, the array of match_specs and the table. And (2) I have to use a atom to refer to the table.

Am I right about this? or do use these functions in a unintended way?