mdev: Maple DEVelopment tool


This file presents the Perl script mdev. This script is designed to help the development of Maple packages by providing a programming environment and a few tools, such as a simple preprocessor and a makefile.

With mdev, it is not necessary to know how the Maple packages work. Just enter the Maple functions and variables of your package. mdev creates the file that implements the package and takes care of the Maple archives (including the variable libname, provided that you have the standard Maple initialization file .mapleinit in your home directory. If not, then create such an empty file).

Note: in order to make mdev work, you must follow a few conventions that are described further in this file.


Get and install the script

The source file of the script mdev can be found here. Copy this file, add the symbolic link mdev into some directory that is in your $PATH. In the source file, edit the variable $COPYRIGHT.

Programming environment

The script mdev assumes that you have somewhere in your file system a directory named maple . Within this directory, a programming environment for the package MyPack is created by invoking the command mdev -t MyPack. This command creates the following directories and files.

This programming environment has been designed such that it is convenient to work with and that the code is clearly organized.

Writing the source code

The code processed by mdev must be enclosed in a block. A block starts by the tag #<<< and ends by the tag #>>> ; both tags must be put at the beginning of a line. Anything outside a block is ignored. mdev knows a few keywords, which are described below. All keywords start by the special symbol @ and must be put in a comment, since they are not part of the Maple syntax, and within a block.

Function

The source code of a function is to be put into a block. The name of the function is determined to be the first name that is assigned to a procedure, and that is not in a comment. The scope of a function within the package is, by default, local. The keyword @scope allows to set the scope of the function.

The keyword @load specifies that the corresponding function is used for the initialization of the package.

The keyword @noinclude instructs the script not to include the function in the package.

Variable

The variables can also be scoped. The following instructions only declare the variables; initialization can be done by @rawinclude.

Miscellaneous

Other keywords are listed below.

Script invokations

The script mdev supports the following invokations.

Note: the possibility of updating libraries of other packages is interesting for preparing a software distribution that gathers several packages.

Example

The example below shows the sequence of instructions for writing a simple package.

> pwd
$HOME/maple                  # must be in the maple directory
> mdev -t MyPack             # create the programming environment
> cd MyPack/src
> xemacs myfunction.mpl      # edit the function 'myfunction'
> mdev -m                    # create the package and update the archive
> maple
    |\^/|     Maple 8 (DEC ALPHA UNIX)
._|\|   |/|_. Copyright (c) 2002 by Waterloo Maple Inc.
 \  MAPLE  /  All rights reserved. Maple is a registered trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> with(MyPack);
             [myfunction]

LM, Created: 05/31/03 - Last update: 10/14/03
Valid HTML 4.01! Valid CSS!