FunctionPackage: top-levelToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1

top-level-read-eval-print-loop

Arguments: nil

Although the basic algorithm of a Lisp listener is a simple repetition of

(print (eval (read))) 

it is greatly complicated by the need to handle command history, error levels, and other useful features. When an application needs a Lisp listener, often it will be simplest to use this, the default Lisp listener provided by the Allegro CL top level. It takes no arguments, but must be run inside a start-interactive-top-level function.

Thus, the Allegro CL idiom for running a standard Lisp listener communicating with *terminal-io* (this might be done in a *restart-app-function*) looks something like this:

(tpl:start-interactive-top-level *terminal-io* 
       #'tpl:top-level-read-eval-print-loop
        nil)

And the idiom for running a standard Lisp listener inside a window looks something like this:

(process-run-function "My Lisp Listener"
     #'tpl:start-interactive-top-level
     my-window-stream
     #'tpl:top-level-read-eval-print-loop
       nil)

Entry to top-level-read-eval-print-loop establishes additional bindings for certain variables used by the top level loop. These bindings are established inside any bindings established by start-interactive-top-level. The variables and initial binding values are taken from the alist bound to the variable *default-lisp-listener-bindings*.

An operator with this name but with a different definition is used in a Lisp image built with a minimal top level, that is built with the include-tpl argument to build-lisp-image specified nil. See Minimal top levels in building-images.htm for information on minimal top levels. Follow the link to see the definition (Lisp source code) of top-level-read-eval-print-loop in a minimal top level.

See top-level.htm for more information on the top level.


Copyright (c) 1998-2002, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 6.2. This page was not revised from the 6.1 page.
Created 2002.2.26.

ToCDocOverviewCGDocRelNotesIndexPermutedIndex
Allegro CL version 6.2
Unrevised from 6.1