Skip to content

Commit

Permalink
Update clos.md
Browse files Browse the repository at this point in the history
  • Loading branch information
createyourpersonalaccount authored and vindarel committed Nov 12, 2022
1 parent 03c8efc commit fd22cd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clos.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,16 @@ class (whether or not those instances exist yet).

#### Slot documentation

Each slot accepts one `:documentation` option. To obtain its documentation via `documentation`, you need to obtain the slot object. This can be done compatibly using an implementation such as [closer-mop](https://github.com/pcostanza/closer-mop). For instance:
Each slot accepts one `:documentation` option. To obtain its documentation via `documentation`, you need to obtain the slot object. This can be done compatibly using a library such as [closer-mop](https://github.com/pcostanza/closer-mop). For instance:

~~~lisp
(closer-mop:class-direct-slots (find-class 'my-class)) ; list of slots (objects)
(find 'my-slot * :key #'closer-mop:slot-definition-name) ; find desired slot by name
(documentation * t) ; obtain its documentation
~~~

Note however that generally it may be better to document slot accessors instead, as a popular viewpoint is that slots are implementation details and not part of the public interface.

#### Slot type

The `:type` slot option may not do the job you expect it does. If you
Expand Down

0 comments on commit fd22cd8

Please sign in to comment.