defun changed in AutoCAD 2000. This change will be transparent to the great majority of AutoLISP users upgrading from earlier versions of AutoCAD. The change only affects AutoLISP code that manipulated defun definitions as a list structure, such as by appending one function to another, as in the following code:
The internal implementation of(append s::startup (cdr mystartup))
defun-q to define your functions. An attempt to use a defun function as a list results in an error. The following example illustrates the error:
For situations like this, you can use_$ (defun foo (x) 4)
foo
_$ (append foo '(3 4))
; error: Invalid attempt to access a compiled function definition.
You may want to define it using defun-q: #<SUBR @024bda3c FOO>
defun-q instead of defun.
The error message alerts you to the possibility of usingdefun-q function is provided strictly for backward compatibility with previous versions of AutoLISP and should not be used for other purposes. For more information on using defun-q, and the related defun-q-list-set and defun-q-list-ref functions, see the AutoLISP Reference.
The