11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.1 Syntax and Semantics • 55true> which;say> eval( which );proc() print(loc) end procIf the return value from member is false, then the name remainsunassigned (or maintains its previously assigned value).> unassign( ’which’ ):> member( cry, Hello, ’which’ );false> eval( which );whichModule OptionsAs with procedures, a module definition may contain options. The optionsavailable for modules are different from those for procedures. Onlythe options trace, and ‘Copyright...‘ are common to procedures andmodules. The following four options have a predefined meaning for modules:load, unload, package, and record.The load and unload Options The module initialization option isload= pname where pname is the name of a procedure in the declaredexports or locals of the module. If this option is present, then the procedureis called when the module is read from the Maple repository inwhich it is found. The unload = pname option specifies the name of alocal or exported procedure of the module that is called when the moduleis destroyed. A module is destroyed either when it is no longer accessibleand is garbage collected, or when Maple exits.There is a situation that can arise wherein a module is no longeraccessible, and hence subject to garbage collection before the unload=procedure is executed, but becomes accessible again during the execution

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!