Jump to content

defun-q vs defun


AdamW

Recommended Posts

Would someone please give me an didiots guide to the difference between defun-q and defun.

 

I've seen a few routines of late written with defun-q instead of defun. Most also seem to be missing the C: after the defun. ie "defun-q my-lsip" not "defun-q c:my-lisp".

 

Thanks in advance

Link to comment
Share on other sites

In simple terms, defun-q defines a function as a LIST type which may therefore be subsequently manipulated as such; defun defines a function as a subroutine (SUBR)/user-subroutine (USUBR) type, whose definition is no longer exposed and can therefore only be redefined, not modified.

 

Questioning the absence of a c: prefix in a function definition is a far more basic question: the c: prefix simply makes a function symbol available for direct evaluation at the AutoCAD command-line - not all defined functions are intended to be called at the command-line by the user, but rather by other functions within an application.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...