defun-q (AutoLISP)

Defines a function as a list

Supported Platforms: Windows and Mac OS

Signature

(defun-q sym ([arguments] [/ variables ...]) expr ...)
sym

Type: Symbol

A symbol naming the function.

arguments

Type: Integer, Real, String, List, T, or nil

The names of arguments expected by the function.

/ variables

Type: Symbol

The names of one or more local variables for the function.

The slash preceding the variable names must be separated from the first local name and from the last argument, if any, by at least one space.

expr

Type: List

Any number of AutoLISP expressions to be evaluated when the function executes.

Return Values

Type: List or Symbol

The result of the last expression evaluated.

Remarks

The defun-q function is provided strictly for backward-compatibility with previous versions of AutoLISP, and should not be used for other purposes. You can use defun-q in situations where you need to access a function definition as a list structure, which is the way defun was implemented in previous, non-compiled versions of AutoLISP.

If you do not declare any arguments or local symbols, you must supply an empty set of parentheses after the function name.

If duplicate argument or symbol names are specified, AutoLISP uses the first occurrence of each name and ignores the following occurrences.

Examples

(defun-q my-startup (x) (print (list x)))
MY-STARTUP

(my-startup 5)
(5) (5)

Use defun-q-list-ref to display the list structure of my-startup:

(defun-q-list-ref 'my-startup)
((X) (PRINT (LIST X)))