book: add a section on using the Version variable

FossilOrigin-Name: 07f21cbf2dd48d9e6a13cf2d97266fe1158bab95afe0b7a323fb8a7ebcd0d2f1
This commit is contained in:
crc 2019-05-13 20:09:58 +00:00
parent 1e1e5e469d
commit 747f8996f8
3 changed files with 54 additions and 0 deletions

View file

@ -2022,6 +2022,33 @@ Instead of:
i dudumu..
# Checking The Version
RETRO releases add and change things. You can use the `Version`
variable to determine the version in use and react accordingly.
```
@Version #201906 eq? [ 'Needs_2019.6! s:put nl bye ] if
```
This can be also be used to conditionally load compatibility files:
```
(If_newer_than_2016.6,_load_aliases_for_renamed_words)
@Version #201906 gt? [ 'Renamed_2019.6.forth include ] if
```
## Version Number Format
The version is a six digit number encoding the year and month of
the release. So:
201901 is 2019.1
201906 is 2019.6
201911 is 2019.11
A `#100 /mod` will suffice to split these if needed.
# Lexical Scope
RETRO has a single dictionary, but does provide a means of using

View file

@ -0,0 +1,26 @@
# Checking The Version
RETRO releases add and change things. You can use the `Version`
variable to determine the version in use and react accordingly.
```
@Version #201906 eq? [ 'Needs_2019.6! s:put nl bye ] if
```
This can be also be used to conditionally load compatibility files:
```
(If_newer_than_2016.6,_load_aliases_for_renamed_words)
@Version #201906 gt? [ 'Renamed_2019.6.forth include ] if
```
## Version Number Format
The version is a six digit number encoding the year and month of
the release. So:
201901 is 2019.1
201906 is 2019.6
201911 is 2019.11
A `#100 /mod` will suffice to split these if needed.

View file

@ -43,6 +43,7 @@ for me.
'Programming-Techniques-Working-With-Strings
'Programming-Techniques-Writing-Combinators
'Programming-Techniques-Working-With-Assembly
'Checking-The-Version
'Lexical-Scope
'Internals
'Internals-Nga