Mercurial > hg > xemacs-beta
comparison man/cl.texi @ 257:65c19d2020f7 r20-5b27
Import from CVS: tag r20-5b27
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:22:03 +0200 |
parents | 3d6bfa290dbd |
children | 11cf20601dec |
comparison
equal
deleted
inserted
replaced
256:19076a51efde | 257:65c19d2020f7 |
---|---|
519 This function takes a @code{:need} keyword argument, but also | 519 This function takes a @code{:need} keyword argument, but also |
520 accepts other keyword arguments which are passed on to the | 520 accepts other keyword arguments which are passed on to the |
521 @code{member*} function. @code{allow-other-keys} is used to | 521 @code{member*} function. @code{allow-other-keys} is used to |
522 keep both @code{find-thing} and @code{member*} from complaining | 522 keep both @code{find-thing} and @code{member*} from complaining |
523 about each others' keywords in the arguments. | 523 about each others' keywords in the arguments. |
524 | |
525 In Common Lisp, keywords are recognized by the Lisp parser itself | |
526 and treated as special entities. In Emacs, keywords are just | |
527 symbols whose names begin with colons, which @code{defun*} has | |
528 arranged to set equal to themselves so that they will essentially | |
529 be self-quoting. | |
530 | 524 |
531 As a (significant) performance optimization, this package | 525 As a (significant) performance optimization, this package |
532 implements the scan for keyword arguments by calling @code{memq} | 526 implements the scan for keyword arguments by calling @code{memq} |
533 to search for keywords in a ``rest'' argument. Technically | 527 to search for keywords in a ``rest'' argument. Technically |
534 speaking, this is incorrect, since @code{memq} looks at the | 528 speaking, this is incorrect, since @code{memq} looks at the |
5590 @end example | 5584 @end example |
5591 | 5585 |
5592 Lucid Emacs supports @code{#'} notation starting with version 19.8. | 5586 Lucid Emacs supports @code{#'} notation starting with version 19.8. |
5593 | 5587 |
5594 @item | 5588 @item |
5595 The ``backquote'' feature uses a different syntax in Emacs Lisp. | |
5596 | |
5597 @example | |
5598 (defmacro foo (v &rest body) `(let ((,v 0)) @@,body)) ; Common Lisp | |
5599 (defmacro foo (v &rest body) (` (let (((, v) 0)) (@@, body))) ; Emacs | |
5600 @end example | |
5601 | |
5602 @item | |
5603 Reader macros. Common Lisp includes a second type of macro that | 5589 Reader macros. Common Lisp includes a second type of macro that |
5604 works at the level of individual characters. For example, Common | 5590 works at the level of individual characters. For example, Common |
5605 Lisp implements the quote notation by a reader macro called @code{'}, | 5591 Lisp implements the quote notation by a reader macro called @code{'}, |
5606 whereas Emacs Lisp's parser just treats quote as a special case. | 5592 whereas Emacs Lisp's parser just treats quote as a special case. |
5607 Some Lisp packages use reader macros to create special syntaxes | 5593 Some Lisp packages use reader macros to create special syntaxes |
5608 for themselves, which the Emacs parser is incapable of reading. | 5594 for themselves, which the Emacs parser is incapable of reading. |
5609 | |
5610 The lack of reader macros, incidentally, is the reason behind | |
5611 Emacs Lisp's unusual backquote syntax. Since backquotes are | |
5612 implemented as a Lisp package and not built-in to the Emacs | |
5613 parser, they are forced to use a regular macro named @code{`} | |
5614 which is used with the standard function/macro call notation. | |
5615 | 5595 |
5616 @item | 5596 @item |
5617 Other syntactic features. Common Lisp provides a number of | 5597 Other syntactic features. Common Lisp provides a number of |
5618 notations beginning with @code{#} that the Emacs Lisp parser | 5598 notations beginning with @code{#} that the Emacs Lisp parser |
5619 won't understand. For example, @samp{#| ... |#} is an | 5599 won't understand. For example, @samp{#| ... |#} is an |
5620 alternate comment notation, and @samp{#+lucid (foo)} tells | 5600 alternate comment notation, and @samp{#+lucid (foo)} tells |
5621 the parser to ignore the @code{(foo)} except in Lucid Common | 5601 the parser to ignore the @code{(foo)} except in Lucid Common |
5622 Lisp. | 5602 Lisp. |
5603 | |
5604 The number prefixes `#b', `#o', and `#x', however, are supported | |
5605 by the Emacs Lisp parser to represent numbers in binary, octal, | |
5606 and hexadecimal notation (or radix), just like in Common Lisp. | |
5623 | 5607 |
5624 @item | 5608 @item |
5625 Packages. In Common Lisp, symbols are divided into @dfn{packages}. | 5609 Packages. In Common Lisp, symbols are divided into @dfn{packages}. |
5626 Symbols that are Lisp built-ins are typically stored in one package; | 5610 Symbols that are Lisp built-ins are typically stored in one package; |
5627 symbols that are vendor extensions are put in another, and each | 5611 symbols that are vendor extensions are put in another, and each |