The AL language allows the user to write implement entirely new
procedures in ANSIG, in a way which is much more powerful than is
possible with ordinary macros. There is a library of AL procedures in
the distribution in the ansig/lib subdirectory.
COMPILE
or RECOMPILE.
The compiler checks for syntax and type errors. If an
error is detected, then the offending line with its sequential number
in the file is output, with an approximate position of the error. No
AL procedures from the file are kept if an error occurs in it.
All AL procedures currently compiled into ANSIG can be removed by the
INITIALIZE command.
The invokation is performed as part of the usual command line processing, after variable and query substition.
There is no difference in the invokation of intrinsic or compiled procedures.
If the AL procedure returns a result, then it will be put into the command line instead of the invokation, before the command line is executed. It is therefore possible to give commands which do different things according to what value is returned by an AL procedure invokation in it.
For example, some simple calculations can be done like this:
It is possible to invoke AL procedures from the command line in a nested fashion; the innermost are executed first, so that their results can be used as arguments for the outermost AL procedure.ANSIG> echo Add (1.0, 3.0) 4.000000E+00 ANSIG> echo Exp (2.0) 7.389056E+00 ANSIG> echo Add (Exp (1.0), Sin (45.0)) 3.569185E+00
AL procedures which return lists, give the list name as result. The list name consists of a capital L and a number, which is guaranteed to be unique. It is often useful to rename the list in the same command as the Al procedure invokation. Use the RENAME command:
ANSIG> RENAME Spectra() all_spectra
This will create and store a list called all_spectra
containing all spectra.
It is not possible to overload user-written (compiled) AL procedures.
The intrinsics are grouped into the following broad headings: