defun-q


(defun-q  name  ( [ args ... ] [ / vars ...] ) expr ... )

Same as defun, but keeps the function definition as a list of symbols + expressions; obsolete, should be used only in very rare cases (i..e for S::STARTUP function definition).

Arguments

name  name of Lisp function (if prefixed by C: then the Lisp function is also a command)

args  (optional) 1 or more Lisp symbols, passed to this function as arguments

vars  (optional) 1 or more Lisp symbols, declared as local variables, which are only valid within this function

expr  1 or more Lisp expressions to be evaluated

Return

name  if the function was successfully registered; otherwise a Lisp error is triggered;
returns the result of last evaluated expr, when name function is called via (name)

Example

(defun-q MyTest ( x ) (princ))
(print MyTest)
=> ((X) (princ))

Remarks

if 'name' is prefixed by C: then a command is registered, which can be directly called at commandline, by entering name;
a C: Lisp command must not use the args arguments;
calling (c:name) is also valid to run the function via Lisp;
all local variables are automatically preset as NIL;

if args or vars are used, the / delimiter *MUST* be surrounded by at least 1 space to the left + right !



©  Bricsys NV. All rights reserved.