Add 2010 to copyright years.
[bpt/emacs.git] / doc / misc / cl.texi
index 7c6cd1d..84f9b67 100644 (file)
@@ -5,26 +5,20 @@
 @copying
 This file documents the GNU Emacs Common Lisp emulation package.
 
-Copyright @copyright{} 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-Free Software Foundation, Inc.
+Copyright @copyright{} 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008, 2009, 2010  Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
-license is included in the section entitled ``GNU Free Documentation
-License'' in the Emacs manual.
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software.  Copies published by the Free
-Software Foundation raise funds for GNU development.''
-
-This document is part of a collection distributed under the GNU Free
-Documentation License.  If you want to distribute this document
-separately from the collection, you can do so by adding a copy of the
-license to the document, as described in section 6 of the license.
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
+and with the Back-Cover Texts as in (a) below.  A copy of the license
+is included in the section entitled ``GNU Free Documentation License''.
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.  Buying copies from the FSF supports it in
+developing GNU and promoting software freedom.''
 @end quotation
 @end copying
 
@@ -50,6 +44,8 @@ license to the document, as described in section 6 of the license.
 @insertcopying
 @end titlepage
 
+@contents
+
 @node Top, Overview, (dir), (dir)
 @chapter Introduction
 
@@ -59,6 +55,10 @@ Common Lisp.  All the facilities are described here in detail.  While
 this document does not assume any prior knowledge of Common Lisp, it
 does assume a basic familiarity with Emacs Lisp.
 
+@ifnottex
+@insertcopying
+@end ifnottex
+
 @menu
 * Overview::             Installation, usage, etc.
 * Program Structure::    Arglists, `eval-when', `defalias'
@@ -457,15 +457,26 @@ argument @code{b} as well, since @code{(foo 1 :c 2)} would bind
 @code{b} to the keyword @code{:c}, then signal an error because
 @code{2} is not a valid keyword.
 
-If a @var{keyword} symbol is explicitly specified in the argument
-list as shown in the above diagram, then that keyword will be
-used instead of just the variable name prefixed with a colon.
-You can specify a @var{keyword} symbol which does not begin with
-a colon at all, but such symbols will not be self-quoting; you
-will have to quote them explicitly with an apostrophe in the
-function call.
+You can also explicitly specify the keyword argument; it need not be
+simply the variable name prefixed with a colon.  For example,
 
-Ordinarily it is an error to pass an unrecognized keyword to
+@example
+(defun* bar (&key (a 1) ((baz b) 4)))
+@end example
+
+@noindent
+
+specifies a keyword @code{:a} that sets the variable @code{a} with
+default value 1, as well as a keyword @code{baz} that sets the
+variable @code{b} with default value 4.  In this case, because
+@code{baz} is not self-quoting, you must quote it explicitly in the
+function call, like this:
+
+@example
+(bar :a 10 'baz 42)
+@end example
+
+Ordinarily, it is an error to pass an unrecognized keyword to
 a function, e.g., @code{(foo 1 2 :c 3 :goober 4)}.  You can ask
 Lisp to ignore unrecognized keywords, either by adding the
 marker @code{&allow-other-keys} after the keyword section
@@ -1738,6 +1749,11 @@ generated directly inside Emacs will not be caught since they make
 direct C-language calls to the message routines rather than going
 through the Lisp @code{message} function.
 
+@c Bug#411.
+Also note that many primitives (e.g. @code{+}) have special byte-compile
+handling.  Attempts to redefine such functions using @code{flet} will
+fail if byte-compiled.  In such cases, use @code{labels} instead.
+
 Functions defined by @code{flet} may use the full Common Lisp
 argument notation supported by @code{defun*}; also, the function
 body is enclosed in an implicit block as if by @code{defun*}.
@@ -2599,7 +2615,7 @@ This clause simply counts up to the specified number using an
 internal temporary variable.  The loops
 
 @example
-(loop repeat n do ...)
+(loop repeat (1+ n) do ...)
 (loop for temp to n do ...)
 @end example
 
@@ -5159,7 +5175,7 @@ Emacs Lisp:
         collect (if flag x (funcall func x))))
 
 (defun add-odd-elements (list x)
-  (map-odd-elements (lambda (a) (+ a x))) list)
+  (map-odd-elements (lambda (a) (+ a x)) list))
 @end example
 
 @noindent
@@ -5268,7 +5284,7 @@ than being distinct types.
 @item
 The Common Lisp Object System (CLOS) is not implemented,
 nor is the Common Lisp Condition System.  However, the EIEIO package
-from @uref{ftp://ftp.ultranet.com/pub/zappo} does implement some
+(@pxref{Top, , Introduction, eieio, EIEIO}) does implement some
 CLOS functionality.
 
 @item
@@ -5330,8 +5346,6 @@ recursion.
 
 @printindex vr
 
-@setchapternewpage odd
-@contents
 @bye
 
 @ignore