[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: DEFVAR-DOCUMENTATION (Version 2)
- To: CL-CLEANUP@SAIL.STANFORD.EDU
- Subject: Issue: DEFVAR-DOCUMENTATION (Version 2)
- From: Masinter.pa@Xerox.COM
- Date: 23 Nov 87 13:22 PST
- Cc: Masinter.pa@Xerox.COM
The rationale is extended to point out that no other documentation
string positions are evaluated for any of the other defining forms. I
added an example. I added to the Benefit section about programming
environment tools. (It seems reasonable, for example, to be able to
extract the doc string from the defining form at "code-walk" time.)
These changes are in response to more than one "why not?" query at
References: DEFVAR, DEFPARAMETER, DEFCONSTANT (pp68-9)
Edit history: 30-Jun-87, Version 1 by Pitman
23-Nov-87, Version 2 by Masinter
CLtL is not explicit about whether the documentation part of DEFVAR,
DEFPARAMETER, and DEFCONSTANT special forms is evaluated.
Clarify that the documentation part of DEFVAR, DEFPARAMETER, and
DEFCONSTANT special forms is not evaluated. That is, it must be a
literal string, not a form which evaluates to a string.
(DEFVAR *MY-VARIABLE* (CONSTRUCT-INITIAL-VALUE) "A documentation
string") ; OK
(DEFVAR *MY-VARIABLE* (CONSTRUCT-INITIAL-VALUE)
GENERIC-DOCUMENTATION-STRING) ; would be an error
To ensure portability, implementations must agree on whether or not this
position is evaluated. Specifying that the position is unevaluated is
the conservative thing to suggest, and consistent with the (unevaluated)
documentation strings in DEFUN, DEFSTRUCT.
Some implementations evaluate this position. Others do not.
Cost to implementors:
Implementations that did not already check might usefully add a check in
the macro expansion for DEFVAR, DEFPARAMETER and DEFCONSTANT to assert
that the DOCUMENTATION, if supplied, was a string. The change is likely
Code which uses other than a literal string is not portable, so no
portable programs will be broken. Some non-portable programs which rely
on a particular vendor's interpretation would have to be rewritten.
Automatic tools to detect most offending cases could trivially be
constructed. (We know of no current uses.)
Code portability would be improved. Some programming environment tools
might assume that documentation strings were determinable without
Slight improvement; this implies consistent treatment for documentation
strings in all defining forms.
We think this is a good idea.
----- End Forwarded Messages -----