As Declt
evolves over time, you might one day feel the need for
conditionalizing your code on the version of the library.
The first thing you can do to access the current version number of
Declt
is use the version
function.
Return the current version number of Declt
. TYPE can be one of
:number
, :short
or :long
. For :number
, the
returned value is a fixnum. Otherwise, it is a string.
A Declt
version is characterized by 4 elements as described below.
*release-major-level*
.
*release-minor-level*
.
*release-status*
. The
status of a release can be :alpha
, :beta
, :rc
(standing for “release candidate”) or :patchlevel
. These are in
effect 4 levels of expected stability.
*release-status-level*
. Status levels start at 1 (alpha 1, beta 1
and release candidate 1) except for stable versions, in which case patch
levels start at 0 (e.g. 2.4.0).
In addition to that, each version of Declt
(in the sense
major.minor, regardless of the status) has a name, stored in the
parameter *release-name*
. The general naming theme for Declt
is “Star Trek Characters”.
Here is how the version
function computes its value.
:number
is computed as major . 10000 + minor .
100 + patchlevel, effectively leaving two digits for each level. Note
that alpha, beta and release candidate status are ignored in version
numbers (this is as if the corresponding status level was considered to
be always 0). Only stable releases have their level taken into account.
:short
version will appear like this for unstable releases:
1.3a4, 2.5b8 or 4.2rc1. Remember that alpha, beta or release candidate
levels start at 1. Patchlevels for stable releases start at 0 but 0 is
ignored in the output. So for instance, version 4.3.2 will appear as-is,
while version 1.3.0 will appear as just 1.3.
:long
version is expanded from the short one, and includes the
release name. For instance, 1.3 alpha 4 "Uhura", 2.5 beta 8 "Scotty",
4.2 release candidate 1 "Spock" or 4.3.2 "Counselor Troy". As for the
short version, a patchlevel of 0 is ignored in the output: 1.3 "Uhura".
Incidentally, but you will probably never need to use it, Declt
also
exports a variable named *copyright-years*
, which, as its name
suggests, is a string denoting the copyright years for the whole
project.