Suppose I have a list of named patterns:
listofPatterns = {a_Integer, b_Real, c_?StringQ}
I would like to have a mapping from a pattern to a certain value like:
foo[HoldPattern[a_Integer]] = 1;
foo[HoldPattern[b_Real]] = 1.5;
foo[HoldPattern[c_?StringQ]] = "foo";
In order to apply that on my list
foo /@ listofPatterns
And I expect to have {1, 1.5, "foo"}
as a result. What is the best way to achieve that?
Thank you, Davit
foo /@ listofPatterns
and this what I except{1, 1.5, "foo"}
the question is to define foo correctly. $\endgroup$