module-stexi-documentation #:docs-resolver keyword arg

* module/texinfo/reflection.scm (module-stexi-documentation): Make
  #:docs-resolver a keyword argument.  Provide back compat with
  docs-resolver as an optional argument, though.
This commit is contained in:
Andy Wingo 2011-08-23 18:00:02 +02:00
commit 35c0f0672e

View file

@ -288,11 +288,16 @@
(else (lp (cdr forms))))))
(define* (module-stexi-documentation sym-name
#:optional (docs-resolver
(lambda (name def) def)))
#:optional %docs-resolver
#:key (docs-resolver
(or %docs-resolver
(lambda (name def) def))))
"Return documentation for the module named @var{sym-name}. The
documentation will be formatted as @code{stexi}
(@pxref{texinfo,texinfo})."
(if %docs-resolver
(issue-deprecation-warning
"module-stexi-documentation: use #:docs-resolver instead of a positional argument."))
(let* ((commentary (and=> (module-commentary sym-name)
(lambda (x) (string-trim-both x #\newline))))
(stexi (string->stexi commentary))