Next: , Up: Command processor


2.4.1 Basic commands

There are several generally useful commands built-in, along with many others described in subsequent sections:

— command: ,help
— command: ,help command
— command: ,?
— command: ,? command

Requests help on commands. ,? is an alias for ,help. Plain `,help' lists a synopsis of all commands available, as well as all switches. `,help command' requests help on the particular command command.

— command: ,exit
— command: ,exit status
— command: ,exit-when-done
— command: ,exit-when-done status

Exits the command processor. `,exit' immediately exits with an exit status of 0. `,exit status' exits with the status that evaluating the expression status in the interaction environment produces. ,exit-when-done is like ,exit, but it waits until all threads complete before exiting.

— command: ,go expression

,go is like ,exit, except that it requires an argument, and it evaluates expression in the interaction environment in a tail context with respect to the command processor. This means that the command processor may no longer be reachable by the garbage collector, and may be collected as garbage during the evaluation of expression. For example, the full Scheme48 command processor is bootstrapped from a minimal one that supports the ,go command. The full command processor is initiated in an argument to the command, but the minimal one is no longer reachable, so it may be collected as garbage, leaving only the full one.

— command: ,run expression

Evaluates expression in the interaction environment. Alone, this command is not very useful, but it is required in situations such as the inspector and command programs.

— command: ,undefine name

Removes the binding for name in the interaction environment.

— command: ,load filename ...

Loads the contents each filename as Scheme source code into the interaction environment. Each filename is translated first (see Filenames). The given filenames may be surrounded or not by double-quotes; however, if a filename contains spaces, it must be surrounded by double-quotes. The differences between the ,load command and Scheme's load procedure are that ,load does not require its arguments to be quoted, allows arbitrarily many arguments while the load procedure accepts only one filename (and an optional environment), and works even in environments in which load is not bound.

— command: ,translate from to

A convenience for registering a filename translation without needing to open the filenames structure. For more details on filename translations, see Filenames; this command corresponds with the filename structure's set-translation! procedure. As with ,load, each of the filenames from and to may be surrounded or not by double-quotes, unless there is a space in the filenames, in which case it must be surrounded by double-quotes.