Hello everybody.
I'm trying to define a function that accepts a pattern as a parameter. After playing with HoldPattern and HoldAll attributes I'm out of ideas.
Is this at all possible? Here's an example of what I'd like to get:
Remove[f];
f[HoldPattern[Blank[Real]]] := 0;
f[a_] := 1; SetAttributes[f, HoldFirst];
f[_Real] (* expecting to get 0 *)
Pure function will receive a pattern as expected.
Any ideas are welcome.