-
Notifications
You must be signed in to change notification settings - Fork 6
/
Run.aplf
37 lines (37 loc) · 1.53 KB
/
Run.aplf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Run path_;res;qdmx;sep;paths;DLB;DTB;path
⍝ Brings Cider's and Tatin's APIs into ⎕SE and makes sure that the associated user commands will be found.
⍝ This is for version 19.0
⍝ The function is part of the Tatin project.
⍝ Version 0.1.7 from 2024-04-12 ⋄ Kai Jaeger
path←⊃,/1 ⎕NPARTS∊path_,'/../../SessionExtensions/CiderTatin'
:If 19≤⊃(//)⎕VFI{⍵↑⍨¯1+⍵⍳'.'}2⊃# ⎕WG'APLVersion'
⎕SE.⎕EX'_Tatin' ⍝ In case Tatin was saved as part of the session file
:Trap 0
'_Tatin'⎕SE.⎕CY path,'/Tatin/Client.dws'
:Else
qdmx←⎕DMX
⎕←'Copying Tatin from <',path,'> failed (',qdmx.EM,', RC=',(⍕qdmx.EN),')' ⋄ →0
:EndTrap
:Trap 0
⎕SE._Tatin.Admin.EstablishClientInQuadSE ⍬
:Else
qdmx←⎕DMX
⎕←'Attempt to establish Tatin in ⎕SE failed (',qdmx.EM,', RC=',(⍕qdmx.EN),')' ⋄ →0
:EndTrap
DLB←{⍵↓⍨+/∧\' '=⍵}
DTB←{⍵↓⍨-+/∧\' '=⌽⍵}
:If ⎕NEXISTS path,'/Cider' ⍝ People might not have activated Cider
:Trap 0
res←⎕SE.Tatin.LoadDependencies(path,'/Cider')⎕SE
:If ~∨/'_Cider_'⍷∊⍕res
⎕←'Attempt to load the "Cider" package failed'
:EndIf
:Else
qdmx←⎕DMX
⎕←'Attempt to load the "Cider" package failed (',qdmx.EM,', RC=',(⍕qdmx.EN),')'
:EndTrap
:EndIf
:EndIf
⎕SE.⎕EX'CiderTatin'
⍝⎕SE.SALTUtils.ResetUCMDcache ¯1
⍝Done