We already have a documentation shortcut in define-generic, allowing documentation after the initial generic declaration:
(define-generic add ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys)
"Adds A and B, coercing them to fixnum if the sum is too big."
(if coerce-to-fixnum
(coerce (+ a b) 'fixnum)
(+ a b)))
This usefully expands to the proper :documentation option of defgeneric.
This inline syntax would be useful in define-class/define-condition*, and is exemplified by Nyxt's define-mode already:
(define-mode annotate-mode ()
"Annotate document with arbitrary comments.
Annotations are persisted to disk, see the `annotations-file' mode slot.
Commands are:
- `annotate-current-url' and `annotate-highlighted-text' to create
annotations.
- `show-annotation' and `show-annotations' to show the annotations
unconditionally.
- And `show-annotations-for-current-url' to show the ones associated with the
current page."
#|...|#)
Would be nice to make it native to define-class for even more brevity and ease of use. The downside is that the signature becomes less exact.
We already have a documentation shortcut in
define-generic
, allowing documentation after the initial generic declaration:This usefully expands to the proper
:documentation
option ofdefgeneric
.This inline syntax would be useful in
define-class
/define-condition*
, and is exemplified by Nyxt'sdefine-mode
already:Would be nice to make it native to
define-class
for even more brevity and ease of use. The downside is that the signature becomes less exact.