![]() | ![]() | ![]() | define-repl-command | ![]() |
|
| command-name-spec lambda-list [declaration* | documentation] form* | [Macro] |
Purpose
Define a top-level REPL (read-eval-print loop) command.
Package :common-lisp-user
(also imported into and exported from :module-manager)
Module Defined in extended-repl.lisp
Arguments and values
| command-name-spec | A command-name or a list
(command-name option*)
| |
| lambda-list | A lambda-list | |
| declaration | A declare expression (not evaluated) | |
| documentation | A documentation string (not evaluated) | |
| form | A form |
Detailed syntax
| option ::= | :add-to-native-help | :no-help |
:no-cl-user-function |
Terms
| command-name | A keyword symbol naming the command |
Description
The arguments to the command are not evaluated before
the command is invoked; it is up to the command to perform argument evaluation
if needed (see the example, below).
If the :add-to-native-help option is specified, then the
command and its documentation string are added to the Common
Lisp implementation's primary REPL help; otherwise the command is only added
to the extended-REPL commands help that is displayed by the :commands
REPL command. (Not all Common Lisp implementations distinguish primary and
secondary command-help levels.)
If the :no-help option is specified, then the command is not
added to either the primary or secondary help displays.
An equivalent function in the :common-lisp-user package is normally
defined for the command-name keyword command, and this
function can be used when REPL keyword-command processing is not fully
supported. However, a :common-lisp-user functional version of the
command is not defined if the :no-cl-user-function option is
specified.
Documentation is a documentation string to be associated with the REPL command command-name.
See also
startup-module
Examples
Define a REPL command named :ds to be a handy
shortcut to the Common Lisp describe function:
(define-repl-command (:ds :add-to-native-help) (obj)
"Describe object"
(describe (eval obj)))
Define a REPL command named :my-app that compiles and loads the
module :my-app and sets the current package to the
:gbbopen-user package:
(define-repl-command :my-app (&rest options)
"Compile and load my GBBopen application module"
(startup-module :my-app options :gbbopen-user))
The GBBopen Project
![]() | ![]() | ![]() | define-repl-command | ![]() |