The following features can be used to distinguish between platforms, or characteristics of the platform or of the LispWorks implementation.
Solaris2
AIX PowerPC
System 5 Release 4 machine (for example Solaris2)
Linux
The variant of FreeBSD underlying Mac OS X.
Unix, including all of the above.
Microsoft Windows, including 32-bit and 64-bit.
All images that run on the x86 architecture have this feature. This includes Intel Macintosh, FreeBSD, x86/x86_x64 Linux (32-bit), x86/x64 Solaris (32-bit) and Windows (32-bit).
Note: 64-bit LispWorks does not have this feature.
Images that run on the amd64/x86_64/x64 architecture have each of these features. This includes x86_x64 Linux (64-bit), FreeBSD (64-bit), x86/x64 Solaris (64-bit) and Windows (64-bit).
Images that run on ARM architecture.
Images that run on SPARC architecture.
Images that run on PowerPC architecture.
Images generating Android runtimes.
Images generating iOS runtimes.
The compiler targets a little-endian machine, for instance x86.
The following features are present in LispWorks with the meanings defined for ANSI CL:
Code can distinguish the seventeen current LispWorks implementations like this:
#+(and :mswindows :x86)
"LispWorks (32-bit) for Windows"
#+(and :mswindows :x86-64)
"LispWorks (64-bit) for Windows"
#+(and :linux :x86)
"LispWorks (32-bit) for x86/x86_64 Linux"
#+(and :linux :x86-64)
"LispWorks (64-bit) for x86_64 Linux"
#+(and :linux :arm
(not :android-delivery)
(not :ios-delivery))
"LispWorks (32-bit) for ARM Linux"
#+(and :freebsd :x86)
"LispWorks (32-bit) for FreeBSD"
#+(and :freebsd :x86-64)
"LispWorks (64-bit) for FreeBSD"
#+(and :aix :lispworks-32bit)
"LispWorks (32-bit) for AIX/PowerPC"
#+(and :aix :lispworks-64bit)
"LispWorks (64-bit) for AIX/PowerPC"
#+(and :darwin :x86 (not :ios-delivery))
"LispWorks (32-bit) for Macintosh"
#+(and :darwin :x86-64)
"LispWorks (64-bit) for Macintosh"
#+(and :solaris2 :x86)
"LispWorks (32-bit) for x86/x64 Solaris"
#+(and :solaris2 :x86-64)
"LispWorks (64-bit) for x86/x64 Solaris"
#+(and :sparc :lispworks-32bit)
"LispWorks (32-bit) for SPARC Solaris"
#+(and :sparc :lispworks-64bit)
"LispWorks (64-bit) for SPARC Solaris"
#+:android-delivery
"LispWorks (32-bit) for Android Runtime"
#+(and :ios-delivery :x86)
"LispWorks (32-bit) for iOS Runtime simulator"
#+(and :ios-delivery :arm)
"LispWorks (32-bit) for iOS Runtime"
The following features can be used to distinguish between versions of LispWorks:
All major version 4 releases.
Release 4.4.x
All major version 5 releases.
Release 5.0.x
Release 5.1.x
All major version 6 releases.
Release 6.0.x
Release 6.1.x
All major version 7 releases.
Release 7.0.x
Code using new LispWorks functionality should be conditionalized only using features representing earlier versions, so as to future-proof your code:
(defvar *feature-added-in-LispWorks-7.0*
#+(or lispworks4 lispworks5 lispworks6) nil
#-(or lispworks4 lispworks5 lispworks6) t)
This is because a feature added in LispWorks 7.0 will generally also be in LispWorks 7.1, LispWorks 8.0 and all later versions.
(defvar *feature-added-in-LispWorks-6.1*
#+(or lispworks4 lispworks5 lispworks6.0) nil
#-(or lispworks4 lispworks5 lispworks6.0) t)
We have seen several problematic examples like this:
(defvar *feature-added-in-LispWorks-6.0*
#+lispworks6 t
#-lispworks6 nil)
which breaks in LispWorks 7.0, because that release does not contain the :lispworks6
feature.
In general you should use use the:lispworks
x and :lispworks
x.
y features "in reverse". That is, make your code work for the latest version of LispWorks and then add conditionalization for any previous versions that you want to support, if needed.
Every LispWorks 5, LispWorks 6 and LispWorks 7 image has exactly one of the features :lispworks-32bit
and :lispworks-64bit
.
The two LispWorks architectures, 32-bit and 64-bit, can be distinguished by the features:lispworks-32bit
or :lispworks-64bit
.
:capi
will appear on *features*
.:cocoa
and :gtk
. The X11/Motif GUI is also available by evaluating (require "capi-motif")
in the GTK+ image.*features*
at load-time or run-time. For example this is true when you put platform-dependent code in fasl files that are shared between multiple platforms.LispWorks User Guide and Reference Manual - 13 Feb 2015