Up: Miscellaneous [Contents][Index]
As FoCus 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
FoCus is use the version
function.
Return the current version number of FoCus. TYPE can be one of
:number
, :short
or :long
. For :number
, the
returned value is a fixnum. Otherwise, it is a string.
A FoCus 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 FoCus (in the sense
major.minor, regardless of the status) has a name, stored in the
parameter *release-name*
. The general naming theme for FoCus
is “Aïkido movements”.
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 "Kote Gaeshi", 2.5 beta 8 "Irimi
Nage", 4.2 release candidate 1 "San Kyo" or 4.3.2 "Suwari Wasa Shomen
Uchi Ikkyo". As for the short version, a patchlevel of 0 is ignored in
the output: 1.3 "Ju Wasa".
Up: Miscellaneous [Contents][Index]