Question: Why don't error strings invoke ModuleDeconstruct for a Maple object?

The help page for ?error says the following:

  • A numbered parameter of the form %n displays the nth msgParam in lprint notation.

However this is not literally true if %n happens to refer to a Maple object.  When a Maple object is lprint-ed, it looks for the object's ?ModuleDeconstruct method and uses that.  But in fact if M is an object, an error call like

error "invalid input: object %1 is wrong", M

displays M using its module shell

   Error, invalid input: object  module() export.... local... option object; end module  is wrong.

This is ugly and seems to contradict the ?error help page.  Why isn't the ModuleDeconstruct method of M invoked?  It is one of the few circumstances where an object is displayed "raw" without using either its ModulePrint or ModuleDeconstruct methods.  And can anyone suggest a workaround?

Sorry, don't have access to Maple 18, the above is for my M17.




Please Wait...