17.4 Version Numbers
A valid version string following Racket conventions has one of the following forms:
‹maj›.‹min›
‹maj›.‹min›.‹sub›
‹maj›.‹min›.‹sub›.‹rel›
subject to the following constraints:
‹maj›, ‹min›, ‹sub›, and ‹rel› are all canonical decimal representations of Nats (i.e., decimal digits with no leading 0 unless exactly 0);
‹rel› is not 0;
‹sub› is not 0 unless ‹rel› is included;
‹min› has no more than two digits;
‹sub› and ‹rel› have no more than three digits.
The constraints force version numbers to be in a canonical form. For example, a would-be version string "4.3.0" must be written instead as "4.3", "4.3.1.0" must be written instead as "4.3.1", and rhombus("4") must be written as "4.0".
17.4.1 Version Number Comparison
| import: rhombus/version open | package: rhombus-lib |
A version number of the form ‹maj›.‹min›, ‹maj›.‹min›.‹sub›, or ‹maj›.‹min›.‹sub›.‹rel›, is an “alpha” version if ‹min› is 90 or more, ‹sub› is 900 or more, or ‹rel› is 900 or more.
17.4.2 Version-Dependent Expansion
| import: rhombus/version_meta | package: rhombus-lib |
nestable declaration | ||||
| ||||
| ||||
definition | ||||
| ||||
| ||||
expression | ||||
| ||||
| ||||
nestable declaration | ||||
| ||||
| ||||
definition | ||||
| ||||
| ||||
expression | ||||
| ||||
| ||||
nestable declaration | ||||
| ||||
| ||||
definition | ||||
| ||||
| ||||
expression | ||||
| ||||
| ||||
nestable declaration | ||||
| ||||
| ||||
definition | ||||
| ||||
| ||||
expression | ||||
| ||||
| ||||
|
The version_meta.if_racket_at_least and version_meta.when_racket_at_least forms similarly select depending on whether the host Racket version (as reported by system.racket_version) is at least vers.
version_meta.when_at_least "0.1":
use_static // not available before version 0.1