Next: , Previous: *darwin-framework-directories*, Up: Libraries


define-foreign-library

Syntax

— Macro: define-foreign-library name { load-clause }* => name

load-clause ::= (feature { library }*)

Arguments and Values

name
A symbol.
feature
A feature expression.
library
A library designator.

Description

Creates a new library designator called name. The load-clauses describe how to load that designator when passed to load-foreign-library or use-foreign-library.

When trying to load the library name, the relevant function searches the load-clauses in order for the first one where feature evaluates to true. That happens for any of the following situations:1

  1. If feature is a symbol (idiomatically a keyword), a symbol with the same name, but interned into the cffi-features package, is present in common-lisp:*features*.
  2. If feature is a list, depending on (first feature), a keyword:
    :and
    All of the feature expressions in (rest feature) are true.
    :or
    At least one of the feature expressions in (rest feature) is true.
    :not
    The feature expression (second feature) is not true.
  3. Finally, if feature is t, this load-clause is picked unconditionally.

Upon finding the first true feature, the library loader then loads each library. The meaning of “library designator” is described in load-foreign-library.

Examples

See Loading foreign libraries.

See Also

load-foreign-library


Footnotes

[1] This is described in cffi-feature-p in libraries.lisp.