FunctionPackage: top-levelToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

top-level-read-eval-print-loop

Arguments:

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. This function does not return. Listeners stop through a non-local exit (triggered, for example, by a call to exit).

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-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version