[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About `defun' in elisp manual
From: |
Pascal J. Bourguignon |
Subject: |
Re: About `defun' in elisp manual |
Date: |
Fri, 28 Dec 2012 12:07:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Xue Fuqiao <xfq.free@gmail.com> writes:
> The GNU Emacs Lisp Reference
> Manual(http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html#Defining-Functions)
> says:
> `defun' is the usual way to define new Lisp functions. It defines the
> symbol NAME as a function that looks like this:
> (lambda ARGUMENT-LIST . BODY-FORMS)
>
> Why is the lambda expression a dotted list? As far as I'm concerned, a
> normal list is enough.
It is not.
All lists are made of conses, and conses are written (a . d)
A proper list is nil or a cons cell where d is a proper list.
A dotted list is a non-nil atom or a cons cell where d is a dotted list.
A circular list is a circular list or a cons cell where d is a circular
list. Oops, that definition is circular. A circular list is a list
where one of the cdr of the cons cells is one of the previous cons
cells. (But not necessarily the first).
Above, BODY-FORM must be a proper list therefore the lambda expression
is a proper list.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
- Re: About `defun' in elisp manual,
Pascal J. Bourguignon <=