[cl-typesetting-devel] Re: cl-pdf vs the fasl cache

Faré fahree at gmail.com
Mon Aug 29 00:33:50 UTC 2005


On 8/28/05, Marc Battyani <marc.battyani at fractalconcept.com> wrote:
>>And since it is an error to evaluate defconstant twice with values
>>that are not EQ, and lists are not EQ between compilation and loading
>>from a fasl, I put the following in specials.lisp:
>>
>>(defmacro defconstant* (name value &optional doc)
>>  `(eval-when (:compile-toplevel :load-toplevel :execute)
>>     (unless (boundp ',name)
>>       (defconstant ,name ,value ,@(when doc (list doc))))))
>>
>>and changed top-level.lisp to use defconstant* with +paper-sizes+.
> 
> OK, is this SBCL compliant? ;-)
>
Yes, precisely. My main platforms are SBCL (on x86 and x86_64)
and clisp (on ARM). SBCL is very anal and refuses to do things
that are not guaranteed to work in the standard. This is sometimes very
frustrating, but ultimately leads to more portable, more reliable software.
There are many workarounds to the limitation on defconstant, but this one
is my favorite (you could also wrap things in a SBCL-specific handler-case,
or fallback to using defparameter -- this solution has the advantage of being
portable and future-proof, unless some implementation gets specifically
bitchy about the use of non-EQ stuff in compile-file'd defconstant's).

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
Freedom is strangely ephemeral. It is something like breathing; one only
becomes acutely aware of its importance when one is choking.
	-- William E. Simon



More information about the cl-typesetting-devel mailing list