Language and System Changes in Maple 9.5 - Maple Programming Help

Language and System Changes in Maple 9.5

 Maple 9.5 includes the following language and system changes.

 For a given function or operator, Maple can now be set up to call the appropriate implementation based on the types of arguments being passed.  For example, you can define a new implementation of + that works only on set arguments. Your function is not invoked for addition of other data-structures, like integers or polynomials.  Instead, the system default or other overload function handles that case.

 The list of overloadable operators has been extended to include list construction [], set construction {}, function application ?(), and index application ?[].
 Binding a module that exports a function named [] (possibly via the with command) overrides the system default behavior of list construction.  Instead of creating a list, your procedure is called with the arguments given between the square brackets.  Any object can be returned.
 When used in conjunction with option overload, operators can be selectively overloaded depending on the argument types.
 For details, see ?use.

New Polynomial Data Structure

 A new polynomial data structure optimized for operations on sparse distributed multivariate polynomials can be created and manipulated by using the SDMPolynom command. This data structure provides more efficient basic polynomial arithmetic than the generic sum.
 For details, see ?SDMPolynom.

Object Constructors

 Module exports with the name ModuleApply, ModulePrint, ModuleLoad, and ModuleUnload now have special meaning.
 Modules are now "appliable" in that the command M(a,b,c) invokes M:-ModuleApply(a,b,c) if M is a module and has a local or export named ModuleApply.
 Modules can now control the way they are displayed. If a module has an export or local named ModulePrint, the result of the ModulePrint() command is displayed instead of the module.
 If a ModuleLoad local or export is present, then this procedure is called when the module is read from the Maple repository in which it is found.
 If a ModuleUnload local or export is present, then this procedure is called when the module is destroyed (when it is no longer accessible and is garbage collected, or when Maple exits).

Package Management

 The unwith command allows you to reverse the effects of the with command.  Because of the side effects caused by using table- or procedure-based packages, it is effective only in a Maple session that uses module-based packages exclusively.
 > with( StringTools ):
 > Reverse( "abcde" );
 ${"edcba"}$ (1)
 > unwith( StringTools );
 > Reverse( "abcde" );
 ${\mathrm{Reverse}}{}\left({"abcde"}\right)$ (2)
 > with( StringTools ):
 > with( context ):
 > unwith( StringTools );