Invoking A+

Invocation From the Shell; Environment

   From Within an Emacs Session

If you start an Emacs session by selecting Emacs/A+ from the main menu, A+ can be invoked within it (with the resulting buffer in a-mode) by pressing the function key F4. When in Emacs, you can modify the effect of the F4 key by entering Control-c a.
        Concurrent Sessions
You can run several Emacs A+ sessions concurrently. You can run A+ in several concurrent Emacs sessions. Moreover, to run concurrent A+ sessions within a single Emacs session, after starting one A+ session, you can rename it by pressing Escape x and entering M-x rename-buffer newname,  then perhaps change to another release using Control-c a, then start another session by pressing F4, then perhaps rename that session and start another one, and so on.

   From a Shell Command Line

A+ can also be invoked from a shell command line, by a+ [options] [script [args]],  where the meaning of the parameters is as follows. The PWD (environment name) environment variable is set on startup.

If you want to suppress all error reports (messages to stderr) for the session, you can put 2>/dev/null at the end of the shell command line.

Invoke A+ using all of the defaults (the default workspace size is 1 MB, or 220 bytes.)
/usr/local/bin/a+ -w 100
Invoke A+ with a 100MB virtual workspace.
/usr/local/bin/a+ -d workstation-name:0.0 graphit expertlevel
Invoke A+ with the environment variable DISPLAY set to workstation-name:0.0, and load the script named graphit with the parameter expertlevel. The value of _argv in the A+ session will be ("graphit";"expertlevel").

A+ uses the search rules described for $load to find the application script graphit. The rules are based on the environment variable APATH. The default setting of APATH is:


APATH is automatically set by A+ on startup and its value is derived from another automatically set A+ environment variable, ATREE. If either if these environment variables exist prior to starting A+ the existing values are used.

It is very important for these variables to be set correctly and it is recommended that A+ set them. If set incorrectly, the wrong versions of s and adap will be loaded.

If customization of APATH is required, it is recommended that it is done after A+ has started:

sys.setenv{"APATH=/look/here/first:",sys.readenv "APATH"}
Correct commands:
sys.system{"unset APATH ATREE;/usr/local/bin/a+"}
$(unset APATH ATREE;/usr/local/bin/a+)

Note: When an A+ process initiates a second A+ process, the second process inherits the value of ATREE and APATH from the first, even if the process is detached. To avoid this, do, e.g.,
sys.system{"unset ATREE APATH;/usr/local/bin/a+"}
$(unset ATREE APATH;/usr/local/bin/a+)© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.