ABSTRACT

This final chapter is about modules, which are one of the major new facilities introduced in Maple 6. They can be used in several ways and we have already used them in a fairly trivial way to provide a local context or block structure in which to execute some code. Maple has the concept of a statement sequence but it does not have the concept of a compound statement or block that most other modern programming languages (e.g., C, C++, Java, Pascal, Modula) have inherited from Algol 60 or LISP, in which local variables can be declared. Modules provide something closer to blocks than existed in earlier versions of Maple although they are still not the same as blocks in other languages. A Maple module is very similar to a procedure that is defined and executed in the same statement, except that the latter returns a value. This is even closer to the behaviour of blocks in other languages except that the procedural syntax is rather convoluted.