Command Interpreter [Topic]

Stella is built on top of a Lisp command interpreter. This interpreter, called TL, provides a uniform user interface for all ports of Common Music by implementing a Lisp read-eval-print loop that accepts command input in addition to lisp forms. Whenever you type to Stella's prompt you are using this underlying interpreter.

TL Parsing rules

The standard macro dispatching forms, such as ( # ' and so on are read via READ, and are processed as forms to evaluate. Input that does not start with a dispatch character is read via READ-LINE and processed as possible command input. Since both commands and general lisp evaulation are supported, it is not possible for the interpreter to distinguish between a line of input that is a mistyped command name and a line of input that is intended as a variable to evaluate. It is therfore necessary to force Lisp evaluation of ambigious input by preceding input by a comma. The following examples show the two different interpretations of the input "foo":

Stella [Top-Level]: foo
"FOO" is not a command.

Stella [Top-Level]: ,foo
The symbol FOO has no value.
Command Specification

Commands are case insensitive and are matched against a command set. Only enough of a command name needs to be specified to uniquely identify it in the command set. As mentioned earlier, commands are normally processed "line by line", using Lisp's READ-LINE function. However, there may be cases where a command is more legible when it spans more than one line:

Stella [Top-Level]:  {map foo when (> $rhythm .1)
                           sum $rhythm
                           collect $note}
                              
Starting and Resuming the Command Interpreter

To start Stella, use the (stella:stella) Lisp function. To resume from error breaks, use the :tl break command if in Franz or Akcl. In MCL use Command-. in ACLPC select Return to Top-Level from the Restart menu options. Reinvoking (tl:tl) under a break will throw back to tl's command loop in any Lisp implementation. The following example demonstrates resuming from an error in Allegro Common Lisp:

Stella [Top-Level]: (car 1)
Error: Attempt to take the car of 1 which is not a cons.

Restart actions (select using :continue):
0: Return to Top-Level.
1: Exit Top-Level.
[1]  :tl

Stella [Top-Level]: 


Last Modified: 5-Mar-1998