Mercurial > hg > xemacs-beta
comparison man/cl.texi @ 446:1ccc32a20af4 r21-2-38
Import from CVS: tag r21-2-38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:37:21 +0200 |
parents | abe6d1db359e |
children | 2923009caf47 |
comparison
equal
deleted
inserted
replaced
445:34f3776fcf0e | 446:1ccc32a20af4 |
---|---|
1071 A symbol naming a variable. In other words, @code{(setf x y)} is | 1071 A symbol naming a variable. In other words, @code{(setf x y)} is |
1072 exactly equivalent to @code{(setq x y)}, and @code{setq} itself is | 1072 exactly equivalent to @code{(setq x y)}, and @code{setq} itself is |
1073 strictly speaking redundant now that @code{setf} exists. Many | 1073 strictly speaking redundant now that @code{setf} exists. Many |
1074 programmers continue to prefer @code{setq} for setting simple | 1074 programmers continue to prefer @code{setq} for setting simple |
1075 variables, though, purely for stylistic or historical reasons. | 1075 variables, though, purely for stylistic or historical reasons. |
1076 The macro @code{(setf x y)} actually expands to @code{(setq x y)}, | 1076 The form @code{(setf x y)} actually expands to @code{(setq x y)}, |
1077 so there is no performance penalty for using it in compiled code. | 1077 so there is no performance penalty for using it in compiled code. |
1078 | 1078 |
1079 @item | 1079 @item |
1080 A call to any of the following Lisp functions: | 1080 A call to any of the following Lisp functions: |
1081 | 1081 |
4579 @node Hash Tables, Structures, Lists, Top | 4579 @node Hash Tables, Structures, Lists, Top |
4580 @chapter Hash Tables | 4580 @chapter Hash Tables |
4581 | 4581 |
4582 @noindent | 4582 @noindent |
4583 Hash tables are now implemented directly in the C code and documented in | 4583 Hash tables are now implemented directly in the C code and documented in |
4584 @ref{Hash Tables,,, lispref, XEmacs Lisp Programmer's Manual}. | 4584 @ref{Hash Tables,,, lispref, XEmacs Lisp Reference Manual}. |
4585 | 4585 |
4586 @ignore | 4586 @ignore |
4587 A @dfn{hash table} is a data structure that maps ``keys'' onto | 4587 A @dfn{hash table} is a data structure that maps ``keys'' onto |
4588 ``values.'' Keys and values can be arbitrary Lisp data objects. | 4588 ``values.'' Keys and values can be arbitrary Lisp data objects. |
4589 Hash tables have the property that the time to search for a given | 4589 Hash tables have the property that the time to search for a given |
5097 | 5097 |
5098 @example | 5098 @example |
5099 (assert (> x 10) t "x is too small: %d") | 5099 (assert (> x 10) t "x is too small: %d") |
5100 @end example | 5100 @end example |
5101 | 5101 |
5102 This usage of @var{show-args} is an extension to Common Lisp. In | 5102 This usage of @var{show-args} is a change to Common Lisp. In |
5103 true Common Lisp, the second argument gives a list of @var{places} | 5103 true Common Lisp, the second argument gives a list of @var{places} |
5104 which can be @code{setf}'d by the user before continuing from the | 5104 which can be @code{setf}'d by the user before continuing from the |
5105 error. Since Emacs Lisp does not support continuable errors, it | 5105 error. |
5106 makes no sense to specify @var{places}. | 5106 @end defspec |
5107 @end defspec | 5107 |
5108 | 5108 @defspec check-type place type &optional string |
5109 @defspec check-type form type [string] | 5109 This form verifies that @var{place} evaluates to a value of type |
5110 This form verifies that @var{form} evaluates to a value of type | |
5111 @var{type}. If so, it returns @code{nil}. If not, @code{check-type} | 5110 @var{type}. If so, it returns @code{nil}. If not, @code{check-type} |
5112 signals a @code{wrong-type-argument} error. The default error message | 5111 signals a continuable @code{wrong-type-argument} error. The default |
5113 lists the erroneous value along with @var{type} and @var{form} | 5112 error message lists the erroneous value along with @var{type} and |
5114 themselves. If @var{string} is specified, it is included in the | 5113 @var{place} themselves. If @var{string} is specified, it is included in |
5115 error message in place of @var{type}. For example: | 5114 the error message in place of @var{type}. For example: |
5116 | 5115 |
5117 @example | 5116 @example |
5118 (check-type x (integer 1 *) "a positive integer") | 5117 (check-type x (integer 1 *) "a positive integer") |
5119 @end example | 5118 @end example |
5120 | 5119 |
5121 @xref{Type Predicates}, for a description of the type specifiers | 5120 @xref{Type Predicates}, for a description of the type specifiers |
5122 that may be used for @var{type}. | 5121 that may be used for @var{type}. |
5123 | 5122 |
5124 Note that in Common Lisp, the first argument to @code{check-type} | 5123 Note that as in Common Lisp, the first argument to @code{check-type} |
5125 must be a @var{place} suitable for use by @code{setf}, because | 5124 should be a @var{place} suitable for use by @code{setf}, because |
5126 @code{check-type} signals a continuable error that allows the | 5125 @code{check-type} signals a continuable error that allows the user to |
5127 user to modify @var{place}. | 5126 modify @var{place}, most simply by returning a value from the debugger. |
5128 @end defspec | 5127 @end defspec |
5129 | 5128 |
5130 The following error-related macro is also defined: | 5129 The following error-related macro is also defined: |
5131 | 5130 |
5132 @defspec ignore-errors forms@dots{} | 5131 @defspec ignore-errors forms@dots{} |