Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • $\begingroup$ Wait a minute, why can't you use _?(Context @@ # == "X`" &) ? $\endgroup$ Commented Jan 21, 2013 at 15:41
  • $\begingroup$ @Mr.Wizard Context expects a symbol or string, so Context[X`x[]] generates an error. $\endgroup$ Commented Jan 21, 2013 at 15:44
  • $\begingroup$ Why would it see that in your example? How else are you using this pattern? $\endgroup$ Commented Jan 21, 2013 at 15:45
  • $\begingroup$ I don't think I understand your requirements so I've lifted my vote for the time being. I cannot figure out what you're actually trying to match. It seems to me that something like a_Symbol[___] /; Context[a] === "X`" may be better. Would you please try to explain in more detail what you're doing? $\endgroup$ Commented Jan 21, 2013 at 15:50
  • $\begingroup$ @Mr.Wizard that would work just as well, and I figured the answers would be straight forward. $\endgroup$ Commented Jan 21, 2013 at 16:04