Suppose that I have a list, allSpecies, that contain a set of symbols, each of which has been assigned a new notation using Notation[...]. As an example, the internal representation is C60s, and the display form is C60* (but with the * back against the C -- not sure how to do that on StackExchange).
I now want to define a new Notation for single-parameter functions of any of the symbols that are in allSpecies. So C60* [t] (for any t) could be entered as and would be displayed as [C60*]t. Critically, I only want this alternate functional notation if the symbol is in allSpecies.
I have tried to accomplish this following the model shown here. So I defined:
StringMemberQ[any___]:=MemberQ[ToExpression[any]
And I then used the Notation palette to add a Notation entry. The left-hand side became [stuff1]t_ and the right-hand side became stuff2[t_], where the two "stuff" parts I began with InsertPatternWrapper from the palette, and Stuff1 was a_/;StringMemberQ[a,allSpecies], and Stuff2 was a_/;MemberQ[a,allSpecies]. But it doesn't work. Here is the expanded version of the code:
Notation[ParsedBoxWrapper[
SubscriptBox[
RowBox[{"[", TemplateBox[{RowBox[{"a_", "/;",
RowBox[{"StringMemberQ", "[",
RowBox[{"a", ",", "allSpecies"}], "]"}]}]},
"NotationPatternTag"], "]"}], "t_"]]
\[DoubleLongLeftRightArrow]
ParsedBoxWrapper[
RowBox[{
TemplateBox[{
RowBox[{"a_", "/;",
RowBox[{"MemberQ", "[",
RowBox[{"a", ",", "allSpecies"}], "]"}]}]},
"NotationPatternTag"], "[", "t_", "]"}]]]
Any suggestions are greatly appreciated!