Skip to content

Commit ff479c6

Browse files
committed
Synax change: <Version> now returns a simple string with the version number
1 parent 219e4d0 commit ff479c6

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

APLSource/Admin/Make.aplf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Make flag;M;C;path;zipFilename;res;cfg;parms
22
:If flag
3+
:If 0=⎕SE.⎕NC'MakeHelpers'
4+
{}⎕SE.Tatin.LoadPackages'[tatin]MakeHelpers'⎕SE
5+
:EndIf
36
M←⎕SE.MakeHelpers
47
C←##.CiderConfig
58
path←C.HOME,'/',C.CIDER.distributionFolder
6-
cfg←⎕JSON⍠('Dialect' 'JSON5')⊢⊃⎕NGET C.HOME,'/apl-package.json'
7-
cfg←M.EditVersion cfg
9+
:If ⎕NULL≡cfg←M.EditPackageConfigFile C.HOME
10+
⎕←'Cancelled by user' ⋄ →0
11+
:EndIf
812
M.RecreateFolder path
913
parms←⎕SE.Tatin.CreateBuildParms C.HOME
1014
parms.targetPath←C.CIDER.distributionFolder

APLSource/OS.aplc

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,39 @@
99

1010
⎕IO←1 ⋄ ⎕ML←1
1111

12-
∇ r←Version;buff;history;date
13-
:Access Public shared
14-
⍝ Returns the version number from TatinVars
12+
∇ r←Version
13+
:Access Public Shared
14+
⍝ Returns the version number from `TatinVars` if possible.
1515
⍝ See also `History`
1616
:If 0<⎕NC'TatinVars.CONFIG'
17-
buff←(⎕JSON⍠('Dialect' 'JSON5')⊢TatinVars.CONFIG).version
17+
r←(⎕JSON⍠('Dialect' 'JSON5')⊢TatinVars.CONFIG).version
1818
:ElseIf 0<##.⎕NC'TatinVars.CONFIG'
19-
buff←(⎕JSON⍠('Dialect' 'JSON5')⊢##.TatinVars.CONFIG).version
19+
r←(⎕JSON⍠('Dialect' 'JSON5')⊢##.TatinVars.CONFIG).version
20+
:Else
21+
⍝ When a script was not loaded with Tatin, there will be no namespace `TatinVars`.
22+
⍝ In such cases we cannot provide a version number, so we return just ''.
23+
r←''
2024
:EndIf
21-
history←History
22-
date←{⍵↑⍨¯1+⍵⍳' '}'from'{⍵↓⍨(≢⍺)+1⍳⍨⍺⍷⍵}history[1;]
23-
r←'OS'buff date
24-
⍝Done
2525
2626

2727
∇ r←History
2828
:Access Public shared
29-
⍝ * 3.2.0 from 2024-12-25
29+
⍝ * 4.0.0 ⋄ 2025-03-28
30+
⍝ * `Version` has changed its syntax: it returns just a simple string with the version number now
31+
⍝ which comes from the package config file.
32+
⍝ * `Make` improved.
33+
⍝ * 3.2.0 ⋄ 2024-12-25
3034
⍝ * The `Version` functions reports now what's defined in the package config file
3135
⍝ * Packages updated
32-
⍝ * 3.1.1 from 2023-05-08
36+
⍝ * 3.1.1 2023-05-08
3337
⍝ * APLTreeUtils2 updated which was buggy (wrong version number)
34-
⍝ * 3.1.0 from 2023-05-02
38+
⍝ * 3.1.0 2023-05-02
3539
⍝ * New method `GetTaskList` added
3640
⍝ * `History now returns a useful result
37-
⍝ * 3.0.1 from 2021-03-01
41+
⍝ * 3.0.1 2021-03-01
3842
⍝ * Package config file corrected (new format)
3943
⍝ * APLTreeUtils2.Uppercase replaced by a call to 1 ⎕C
40-
⍝ * 3.0.0 from 2020-09-07
44+
⍝ * 3.0.0 2020-09-07
4145
⍝ * Does not :Include APLTreeUtils anymore (but requires the class APLTreeUtils2)
4246
⍝ * Uses ⎕ML←1 and ⎕IO←1 internally
4347
⍝ * Needs at least Dyalog 18.0
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
R←Test_Misc_001(stopFlag batchFlag);⎕TRAP
1+
R←Test_Misc_001(stopFlag batchFlag);⎕TRAP;version
22
⍝ Exercise the `Version` method
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
44
R←T._Failed
55

6-
→T.PassesIf 3=≢##.OS.Version
6+
version←##.OS.Version
7+
→T.PassesIf 1=≢⊆version
8+
→T.PassesIf∧/('+.'~⍨{⍵↑⍨¯1+⍵⍳'-'}version)∊⎕D
79

810
R←T._OK

APLSource/TestCases/Test_Misc_004.aplf

Lines changed: 0 additions & 10 deletions
This file was deleted.

apl-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
source: "APLSource/OS.aplc",
2020
tags: "os-tools,windows,linux,mac-os,dyalog-apl",
2121
userCommandScript: "",
22-
version: "3.2.0+62",
22+
version: "4.0.0+67",
2323
}

0 commit comments

Comments
 (0)