gnu-misc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the difference between defsubst and defun ?


From: Pascal J. Bourguignon
Subject: Re: What is the difference between defsubst and defun ?
Date: Sat, 04 Dec 2010 22:19:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Fren Zeee <address@hidden> writes:

> This is a newbie question.
>
> [Q] In emacs, What is the difference between defsubst and defun ?
>
> I have searched and looked at the documentation but not satisfactory
> answer.
>
> defsubst is a Lisp macro in `byte-run'.
> (defsubst NAME ARGLIST &rest BODY)
> Define an inline function.  The syntax is just like that of `defun'.
>
> defun is a special form.
> (defun NAME ARGLIST [DOCSTRING] BODY...)
>
> Define NAME as a function.
> The definition is (lambda ARGLIST [DOCSTRING] BODY...).
> See also the function `interactive'.
>
> *** What are the key attributes of the inline function in general in
> lisp and in particular in CL and elisp ? ***

(set-difference '(Define an inline function) '(Define NAME as a function))
--> (inline an)

So, I guess the difference is an inline.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]