On 28 Jun 2011, at 17:49, Zach Beane wrote:
> Faré writes:
>>> I am looking for a portable way to specify configuration for a library
>>> before/during loading with ASDF2. It would be sufficient if the user
>>> could specify an ALIST (or something similar) somewhere and I could
>>> use it when the library is loaded. Does ASDF2 have a "standard"
>>> mechanism for library config files (eg where they are, how to handle
>>> etc), or should I use something else? I thought of using *features*,
>>> I need actual values instead of merely checking for the presence of
>> ASDF (1 or 2) does not handle C libraries. Extensions to ASDF do.
> The question is not about C libraries, but how to express and manage
> configuration options that must be initialized before the library is
> I think the answer for ASDF is "there is no way to express or manage any
> library configuration decisions."
> Hunchentoot also has this issue regarding building with SSL, and manages
> it by checking for :hunchentoot-no-ssl in cl:*features*. For a
> non-boolean option, that's not a workable approach.
One could use a global variable that stores one's own configuration option,
for example as a plist or alist. This would have to be in the
common-lisp-user package, and theoretically clashes with other such
variables. However, this is not substantially worse than potential clashes
of keyword symbols in *features*. Just use a name that is unlikely to be
used by others (for example, by using the ASDF/package name with an
-OPTIONS suffix, or some such).
boundp is your friend to check whether the variable is actually defined,
which could either yield a warning, or assume default options.
The views expressed in this email are my own, and not those of my employer.