[mcclim-devel] A tough day for me and McCLIM

Peter Scott sketerpot at gmail.com
Sat Apr 2 17:22:18 UTC 2005


On Apr 1, 2005 4:48 PM, rpgoldman at sift.info <rpgoldman at sift.info> wrote:
> The proximate cause seems to be PRINT-DOCUMENTATION, which pulls the
> documentation and then tries to print it, as can be seen in this
> error:
> 
> CL-USER(171): (documentation *taems-model* t)
> Error: Attempt to access the plist field of
>        #<TAEMS-MODEL @ #x72023142> which is not a symbol.
>   [condition type: SIMPLE-ERROR]
> 
> Restart actions (select using :continue):
>  0: Return to Top Level (an "abort" restart).
>  1: Abort entirely from this process.
> 
> Does this mean that ACL is not doing the Right Thing with the
> documentation function?  Or is CLOUSEAU wrong to assume that
> everything will have documentation? Seems like documentation might not
> be defined on objects, if I read the CLHS correctly.

I'd say that ACL does indeed have a problem with documentation.
According to CLHS, "The generic function documentation returns the
documentation string associated with the given object if it is
available; otherwise it returns nil." On SBCL you also get a warning
saying that the type of documentation you asked for is not supported.
But throwing an exception seems wrong; CLHS says that DOCUMENTATION
has no exceptional situations.

And, judging by the cryptic nature of the error, I'm almost certain
that it's an ACL bug.

> The following change to PRINT-DOCUMENTATION seems to fix my problem.
> Not sure how right it is, though.
> 
> (defun print-documentation (object pane)
>   "Print OBJECT's documentation, if any, to PANE"
>   (when (catch 'no-docs
>           (handler-bind ((warning #'muffle-warning)
>                          (error #'(lambda (c) (declare (ignore c)) (throw 'no-docs nil))))
>             (documentation object t)))
>     (with-heading-style (pane)
>       (format pane "~&Documentation: "))
>     (princ (documentation object t) pane)))

That catch-throw trickery looks a little ugly, but the change
shouldn't hurt anything on any other implementations, so I'll commit
it. Thanks.

-Peter



More information about the mcclim-devel mailing list