National Institute of Advanced Industrial Science and Technology (AIST) This page is a page of the former research institute. We stopped updating on March 31.2001.
E-mail to webmaster (Japanese) E-mail to webmaster (English)
next up previous contents index
Next: Compilation Up: Evaluation Previous: Evaluators

Top-level Interaction

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.

  - [variable]

  + [variable]   ++ [variable]   +++ [variable]   * [variable]   ** [variable]   *** [variable]   *prompt-string* [variable]   *program-name* [variable]   eustop &rest argv [function]   eussig sig code [function]   sigint-handler sig code [function]   euserror code message &rest arg [function]   reset [function]   exit &optional termination-code [function]   h [function]   ! &optional (seq 0) [function]   new-history depth [function]
  • initializes *history* vector to have depth length. Depth input lines are remembered. All the input lines recorded in the current *history* are discarded.


next up previous contents index
Next: Compilation Up: Evaluation Previous: Evaluators

Hirofumi Nakagaki
Fri Mar 22 12:46:38 JST 1996