defun-q
 
 
 

Defines a function as a list

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

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.

Arguments

sym

A symbol naming the function.

arguments

The names of arguments expected by the function.

/ variables

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

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

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.

Return Values

The result of the last expression evaluated.

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)))
See Also