I'm trying to use compiled match specifications for an algorithm whereby I want to find from a set of functions all possible functions that might match a given message.<div><br></div><div>The idea is to extract the arguments pattern and guards from each function and compile them all into one large match specification, with a single MatchFunction corresponding to each function.</div>
<div><br></div><div>What I cant figure out is how to persuade the erlang:ms_test function to return multiple possible matches - it only returns the first match.</div><div><br></div><div>Was thinking that I could use the trace functions somehow to do this, but they don't seem to be available from the erlang_ms_test function.</div>
<div><br></div><div>If anyone has any pointers as to how to do this, they would be greatly appreciated. I know I can run a series of match-specs one at a time, but I expect that compiling them into one large match-spec will be more efficient.</div>