Possible Duplicate:
Strange ::usage behavior in v9

I'm currently finishing up a Mathematica vector calculus package (MMA9.0 on Mac Os X), but have had a persistent problem that I haven't been able to get rid of. Basically, the message

StringMatchQ::strse: "String or list of strings expected at position 1 in StringMatchQ[$Failed,"ToCanonical*"]"

persistently appears in the console (Messages notebook). ToCanonical* can be replaced with another function name, depending on what is called. As is standard, 3 messages are printed before a General::stop message is printed.

This behavior only happens on some function executions (i.e. evaluating the same line will sometimes produce it and sometimes not) and often does not start until a dozen or so function calls have been made after loading the package. In addition, after the messages start appearing, they sometimes continue even when nothing in the notebook is being evaluated. The messages seem to have no adverse consequences other than causing Mathematica to pause for 5-10 seconds before doing anything useful, a behavior that persists even if the relevant message is turned off with Off.

With the goal of figuring out what's going on, here are a couple of more specific questions I have that may provide some insight.

  1. What is the difference between messages printed to the console and those printed to the user's notebook? From the Preferences/Messages window it seems that the messages are probably "User log interface messages," but I couldn't find any information on why these would be generated.

  2. Is there a way to generate a list of all MMA functions that can generate $Failed? I do not use $Failed anywhere in the package so it must be being generated by an internal function.

I'm sorry for the rather general question, but am currently completely stuck. Any suggestions would be very much appreciated!


Browse other questions tagged or ask your own question.