![]() |
|
EusLisp's standard top-level read-eval-print loop is controlled by eustop. When EusLisp is invoked, eustop tries to load the file named ".eusrc" in your home directory or the file specified by the EUSRC environment variable. Then EusLisp loads files specified in its argument list. After these loading, eustop enters normal interactive session.
When *standard-input* is connected to user's tty, eustop prints prompt set in *prompt-string* defaulted to "eus$ ", and inputs commands from *terminal-io* stream. If the input is parenthesized, it is taken as a lisp form and is evaluated by eval. Else if the first symbol of the input line has function definition, the line is automatically parenthesized and evaluated. If no function definition is found, then its special value is examined and the value is printed. If the symbol is unbound, the line is regarded as UNIX command and passed to sh (Bourn's shell). If sh cannot find corresponding unix command, ``command unrecognized" message is printed. Thus, eustop works both as a lisp interpreter and as a unix shell. If you do not wish to execute the input as UNIX command, you may escape the form by preceeding a comma ',' at the begining of the line. This is also useful to see the dynamic value binding when an error occured in the interpretive execution. Since EusLisp adopts lexical scope, we cannot examine the value of local variables outside of the scope unless they are declared special.
Each line input is remembered in *history* vector with a sequence number. You can recall a specific input by ! function as if you were in csh. The difference from csh's history is, you need at least one white space between the exclamaition mark and the sequence number since ! is a function, and you can edit the line interactively with control keys, as in emacs.
^D (EOF) terminates EusLisp normally.
To return abnormal termination code to upper level (usually a csh),
use exit with an appropriate condition code.
eustop sets a signal handler only for SIGINT and SIGPIPE, and other signals are not caught. Thus, signals such as SIGTERM or SIGQUIT cause EusLisp to terminate. In order to catch these signals to avoid termination, use unix:signal function to set user-defined signal handlers.