Function Entry: CLAL-DEFINE-COMMAND

← Prev | ↑ Chapter | Next → | Index | Symbols

Function Entry: CLAL-DEFINE-COMMAND

Name

clal-define-command

Class

clautolisp Extension Function

Syntax

(clal-define-command interactor-name names function [doc])

Arguments and Values

  • interactor-name — a string or symbol naming a registered interactor (or its alias — "debug" for ALDO); see clal-list-interactor-names.
  • names — a list (key word …) of strings; the key must be the word initials (debugger command reference §0).
  • function — a function designator; the command body, applied to the command's parsed string arguments at dispatch.
  • doc — optional help string.

Description

Register an AutoLISP user command of the named interactor's user dictionary (debugger command reference §8; the interactor design's single registration API). The command shadows the interactor's system commands while that interactor is on the stack — command CMD reaches a shadowed system command — and installs whether or not the interactor is currently active: registration precedes activation. A no-op (returns nil) unless the debugger UI is loaded.

Return Values

Always nil.

Side Effects

When the debugger UI is loaded, adds a command to the named interactor's user dictionary; otherwise none.

Affected By

  • Whether the aldo debugger UI is loaded.
  • The set of registered interactors.

Exceptional Situations

Signals an error when interactor-name names no registered interactor; argument-type errors propagate from unwrapping names and resolving function.

Examples

(clal-define-command "NAVI"
  '("wa" "watch-around")
  (lambda (arg) (princ arg))
  "watch-around N — print the neighbourhood")
=> nil

Availability

  • clautolisp: documented (this entry); implemented since clautolisp 1.4.44.
  • AutoCAD: NOT present.
  • BricsCAD: NOT present.

Source Notes

  • clautolisp-only extension; the command protocol is specified by the aldo debugger command reference. See this chapter's Overview.