Package trivial-features
trivial-features ensures consistent *features* across multiple
Common Lisp implementations.
About This PackageSpecification Note References OverviewFor example, on MacOS X platforms, while most Lisps push :DARWIN to *features*, CLISP and Allegro push :MACOS and :MACOSX instead, respectively. Some Lisps might not push any feature suggesting MacOS X at all. trivial-features will make sure all Lisps will have :DARWIN in the *features* list when running on MacOS X. This way, you can write#+darwin foo #-darwin barinstead of #+(or darwin macos macosx) foo #-(or darwin macos macosx) barThe section Specification describes the set of symbols that should or should not be present in cl:*features* on certain circumstances. This specification is implemented by the trivial-features system which supports a handful of Lisps. The test suite is, in effect, an implementation using CFFI that is checked against the various implementations in src/tf-*.lisp. trivial-features is MIT-licenced. SpecificationIntroductionThis is a first draft of a description of what symbols should be present in cl:*features* for various platforms. A possible future direction of this documentation might be a CDR - Common Lisp Document Repository document, if it turns out to be a good idea. (Making the language of this document much more precise will be necessary then.) We will start by limiting ourselves to OS, CPU and endianness features on Windows and POSIX platforms. There are various possible implementation strategies ranging from null implementations (when the host Lisp already pushes the wanted feature) to using FFI (e. g. calling uname() to grab system information. Specification
NoteIt is debatable whether :X86 shouldn't also be exported on x86-64, and :PPC on ppc64. SBCL doesn't. Other ways to handle, for example, the x86/x86-64 case would be to export something like :PC386 in both cases or have an additional :X86-32. Or finally, have just :X86, :PPC, etc, and add :32-BIT-CPU and :64-BIT-CPU features.ReferencesCommon Lisp Hyperspec (TM): Variable *FEATURES*Maintaining Portable Lisp Programs, by Christophe Rhodes, February 5, 2004 | Exported Symbol Index |