[cl-pdf-devel] CMUCL compatibility fixes and new color handling code

Dmitri Ivanov divanov at aha.ru
Tue Apr 13 05:51:51 UTC 2004


Hello Klaus,

| ...snip...|
| Next, the cl-typesetting examples break because the (set-rgb SYMBOL)
| method is implemented only for lispworks, and the examples use color
| specifications such as :red. Other platforms fail with an obscure error
| message.

Agree that the symbolic color specification must not have been included in
the example file :-)
But this feature is that useful and has to be available to other CL
implementations.

| To fix this, I converted the X11 color database (MIT licensed, so that
| should be okay) to Lisp hashes, which provides an adequate selection
| of color names and keywords for all platforms.  Note that I copied the
| list of colors into the source code - so you don't need the X11 file
| unless you want to rebuild that list. I took out the lispworks special
| case while doing that - I'd prefer this part to be platform independent
| ;-)
| 
| I also updated the (get-rgb STRING) method to support color names as
| well as the #rrggbb specifications. Note that I didn't add any error
| handling for undefined colors, since I don't know what the appropriate
| action should be in such a case.

Good proposal. Suggest including x11-colors.lisp as an optional feature,
i.e. conditionalizing the rest of code by something like #+x11-colors and
#-x11-colors.

| Finally, I'm getting a fairly weird message when compiling cl-typeset
| w/ CMUCL, it claims that BOX is being redefined. Apparently the
| (defclass box) in boxes.lisb and the (:accessor box) in tables.lisp
| conflict - what does the standard say about this? That's just a warning
| and it works fine if I let it override the definition, but it isn't
| pretty.

According to the standard, there is no limitation on using the same symbol
as a class name and a function name since those are in different
"namespaces". Please investigate how to suppress the warning on CMUCL.

| Oops, forgot to explain one part of the patch. CMUCL doesn't like the
| :element-type specification for with-output-to-string, and according to
| the standard that indeed doesn't seem to be permitted.

What standard do you refer to? ANSI CL _does allow_ :element-type.
Pragmatically, I need this when dealing with Unicode characters. Suggest
conditionalize with #-cmu.
--
Sincerely,
Dmitri Ivanov
lisp.ystok.ru





More information about the cl-pdf-devel mailing list