diff options
| author | Stefan Monnier | 2019-07-29 11:56:11 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-07-29 11:56:11 -0400 |
| commit | 75361be63fcd42497dd1eb93cab3255833334475 (patch) | |
| tree | b67e1dda5333f799e5df850765e1d68e8d1c77dd /doc/misc | |
| parent | b47ca8125b39b871328da114637449a86050baa5 (diff) | |
| download | emacs-75361be63fcd42497dd1eb93cab3255833334475.tar.gz emacs-75361be63fcd42497dd1eb93cab3255833334475.zip | |
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add slot option :documentation
Use it to improve the docstring of the accessor functions.
* doc/misc/cl.texi: Rename menu entry to "CL-Lib".
(Structures): Add ':documentation' and mention ':type' as well,
which we don't completely ignore any more.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/cl.texi | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index a9197602634..afe8f01f596 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -24,7 +24,7 @@ modify this GNU manual.'' | |||
| 24 | 24 | ||
| 25 | @dircategory Emacs lisp libraries | 25 | @dircategory Emacs lisp libraries |
| 26 | @direntry | 26 | @direntry |
| 27 | * CL: (cl). Partial Common Lisp support for Emacs Lisp. | 27 | * CL-Lib: (cl). Partial Common Lisp support for Emacs Lisp. |
| 28 | @end direntry | 28 | @end direntry |
| 29 | 29 | ||
| 30 | @finalout | 30 | @finalout |
| @@ -4036,12 +4036,6 @@ is either a slot symbol or a list of the form @samp{(@var{slot-name} | |||
| 4036 | is a Lisp form that is evaluated any time an instance of the | 4036 | is a Lisp form that is evaluated any time an instance of the |
| 4037 | structure type is created without specifying that slot's value. | 4037 | structure type is created without specifying that slot's value. |
| 4038 | 4038 | ||
| 4039 | Common Lisp defines several slot options, but the only one | ||
| 4040 | implemented in this package is @code{:read-only}. A non-@code{nil} | ||
| 4041 | value for this option means the slot should not be @code{setf}-able; | ||
| 4042 | the slot's value is determined when the object is created and does | ||
| 4043 | not change afterward. | ||
| 4044 | |||
| 4045 | @example | 4039 | @example |
| 4046 | (cl-defstruct person | 4040 | (cl-defstruct person |
| 4047 | (name nil :read-only t) | 4041 | (name nil :read-only t) |
| @@ -4049,7 +4043,23 @@ not change afterward. | |||
| 4049 | (sex 'unknown)) | 4043 | (sex 'unknown)) |
| 4050 | @end example | 4044 | @end example |
| 4051 | 4045 | ||
| 4052 | Any slot options other than @code{:read-only} are ignored. | 4046 | @var{slot-options} is a list of keyword-value pairs, where the |
| 4047 | following keywords can be used: | ||
| 4048 | |||
| 4049 | @table @code | ||
| 4050 | @item :read-only | ||
| 4051 | A non-nil value means the slot should not be @code{setf}-able; | ||
| 4052 | the slot's value is determined when the object is created and does | ||
| 4053 | not change afterward. | ||
| 4054 | |||
| 4055 | @item :type | ||
| 4056 | The expected type of the values held in this slot. | ||
| 4057 | |||
| 4058 | @item :documentation | ||
| 4059 | A documentation string describing the slot. | ||
| 4060 | @end table | ||
| 4061 | |||
| 4062 | Other slot options are currently ignored. | ||
| 4053 | 4063 | ||
| 4054 | For obscure historical reasons, structure options take a different | 4064 | For obscure historical reasons, structure options take a different |
| 4055 | form than slot options. A structure option is either a keyword | 4065 | form than slot options. A structure option is either a keyword |