[cldoc-devel] use of format and intern in function generating macros

Taylor, Joshua tayloj at rpi.edu
Wed Jul 12 21:19:30 UTC 2006


Hello CLDOC list,

I've just recently checked out a copy CLDOC, and am quite pleased with the
results I'm getting. At first, however, I was running into a slight
bug, but one which
is easy to fix.

In several places in the code:

cludg.lisp:186:	   (defun ,(intern (format nil "~a" s-purger)) (string)
cludg.lisp:191:	   (defun ,(intern (format nil "~a" ll-purger)) (lambda-list)
cludg.lisp:618:  (with-standard-io-syntax (intern (format nil "~a~a"
s1 s2) pkg)))

intern is being called with a string coming from format. In most Lisps
this is not
a problem, and in the one I use (Lispworks) the default settings would have no
problem either. Out of personal preference however, I set *print-case* to
:capitalize, which means that, e.g.,  (format nil "~a" s-purger) would give me
"Purge-String-For-Html" and that the function defined was actually
cldoc:|Purge-String-For-Html|.

Fortunately the fix is easy: just change instances of (format nil "~a" sym) tp
(symbol-name s-sym), and
cludg.lisp:618:  (with-standard-io-syntax (intern (format nil "~a~a"
s1 s2) pkg)))
to
cludg.lisp:618:  (with-standard-io-syntax (intern (concatenate 'string
(symbol-name s1) (symbol-name s2)) pkg)))
although I'm not sure if it's necessary in that second case (as I
don't know the context
of that code).

Once I got those purgers working, the HTML documentation is really beautiful.
I'm very impressed with the project. Thanks for all your hard work!
-- 
=====================
Joshua Taylor
tayloj at rpi.edu



More information about the cldoc-devel mailing list