Skip to content

Commit ae91fe7

Browse files
authored
Merge pull request #716 from Dyalog/714-allow-localised-names
Make WSLoaded ignore wslinks if PRELOAD=Y (and fix bug where emptyns was not updated)
2 parents ccd0eff + 1003f53 commit ae91fe7

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

StartupSession/Link/Create.aplf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ NOHOLD:
7474
onstack←((ns,'.')∘,¨names)∊⎕XSI ⍝ Name on the stack
7575
local←{∨/⊃nsref.⎕STATE ⍵}¨names ⍝ Localised on the stack
7676
names/⍨←onstack⍱local ⍝ ... are allowed in target ns
77+
emptyns←0=≢names
7778
:EndIf
7879

7980
:If ~opts.(preloaded∨flatten)

StartupSession/Link/Version.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version←Version
2-
version←'4.1.3'
2+
version←'4.1.4'

StartupSession/Link/WSLoaded.aplf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
{ok}←WSLoaded;keep;links;msg;wslinks;link;diff;allOK;load;IsLoad;broken;isLoadWs
1+
{ok}←WSLoaded;keep;links;msg;wslinks;link;diff;allOK;load;IsLoad;broken;isLoadWs;preload
22
⍝ Action to be taken upon )LOAD or )CLEAR
33
ok←0
4-
:Trap 0 ⍝ can't afford to error
5-
load←2 ⎕NQ #'GetEnvironment' 'LOAD'
4+
5+
:Trap 0 ⍝ can't afford to error
6+
(load preload)←{2 ⎕NQ #'GetEnvironment' ⍵}¨'LOAD' 'PRELOAD'
67
IsLoad←load∘{⍵.dir∊⍥(1 ⎕NPARTS⊆)⍺}
8+
79
:Hold '⎕SE.Link.Links'
810

911
⍝ retrieve saved workspace links before the GetLinks which may overwrite Store 0
1012
:If ~U.HASSTORE
1113
:OrIf ⎕NULL≡wslinks←U.Store 0
14+
:OrIf (∨/preload∊'1yY')∧load≡⍥{⎕C ∊¯1↓1 ⎕NPARTS ⍵}⎕WSID
15+
⍝ Above: PRELOAD=Y means application intends to recreate links with preloaded:1
1216
wslinks←⍬
1317
:EndIf
1418

Test/test_attributes.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
CleanUp folder name
1010
⎕MKDIR Retry folder
1111
(⊂fn'bar')⎕NPUT aplf←folder,'/',(fn←'foo'),'.aplf'
12-
(dt←2345 6 7 10 20 30)SetTime aplf
12+
(dt←2105 6 7 10 20 30)SetTime aplf
1313

1414
⍝ Check that we import the special datetime
1515
z←LinkCreate name folder

0 commit comments

Comments
 (0)