Unable to save workspace

General APL language issues

Unable to save workspace

Postby nicholas.small on Sun Jun 18, 2023 8:25 am

I'd been using ]Runtime and then got
)save
Cannot perform operation when # is referenced by session namespace.
Reached via:
⎕SE.SALTUtils...dmx...EN

What does this mean and how do I recover from it?
nicholas.small
 
Posts: 23
Joined: Tue Mar 30, 2021 8:45 pm

Re: Unable to save workspace

Postby Morten|Dyalog on Sun Jun 18, 2023 9:14 am

It means that there is a namespace reference somewhere in ⎕SE (most probably in ⎕SE.SALTUtils.dmx) that points to something in the root namespace #. The workspace cannot be saved when references exist between any subspace ⎕SE and any subspace of # (in either direction).

We'll look at whether the ]runtime command can be a bit more careful about this. Meanwhile, you may be able to work around it by expunging ('⎕SE.SALTUtils.dmx') to see whether that clears it up.
User avatar
Morten|Dyalog
 
Posts: 458
Joined: Tue Sep 09, 2008 3:52 pm

Re: Unable to save workspace

Postby Phil Last on Sun Jun 18, 2023 9:20 am

Somewhere in ⎕SE there has been created a namespace (or object or an array that contains such) that is a reference to # or a namespace within it.

If you have a non-empty )si stack then )clearing it might well remove the problem because the reference will almost certainly be localised in one of the ⎕SE functions.

Alternatively it may be that your function has created a global reference in ⎕SE to # or a namespace within it. In this case it will be necessary to examine your code to find and eliminate the offending reference perhaps by localisation and to remove the reference from ⎕SE.
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Unable to save workspace

Postby nicholas.small on Sun Jun 18, 2023 8:41 pm

Thanks, Morten - that resolved the issue.
A couple of other accompanying factors:
1. I had a 'Find' window open when I last ran ]Runtime and when I first tried )save.
2. There were what appeared to me to be spurious blank lines produced after the result of ]Runtime:
]runTime "((200⍴ns)SSASSIGNtest (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5))" "(200⍴ns)SSASSIGNI (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5)" -c

((200⍴ns)SSASSIGNtest (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5)) → 9.3E¯6 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
(200⍴ns)SSASSIGNI (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5) → 1.1E¯5 | +13% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
]runTime "((200000⍴ns)SSASSIGNtest (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000))" "(200000⍴ns)SSASSIGN (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000)" -c

((200000⍴ns)SSASSIGNtest (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000)) → 6.7E¯4 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
(200000⍴ns)SSASSIGN (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000) → 5.9E¯4 | -12% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕




FNS←⎕NL 3 4
The first line is empty and the next three have seven blanks.

I've just twice repeated the commands above. The first time the output was as above, the second time there were no spurious blank lines.
nicholas.small
 
Posts: 23
Joined: Tue Mar 30, 2021 8:45 pm

Re: Unable to save workspace

Postby Adam|Dyalog on Sun Jun 25, 2023 4:52 am

I should add that this ⎕SE.SALTUtils.dmx is a clone of ⎕DMX, stored in SALTUtils as a record of any error that happened during user command execution. It could indeed contain problematic references. In version 19.0, we've ensured that that it doesn't have such issues.
User avatar
Adam|Dyalog
 
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm

Re: Unable to save workspace

Postby Vince|Dyalog on Mon Jun 26, 2023 11:11 am

Hi Nicholas,

If this happens to you again, please try a )reset and see if that helps.

Also, in general, you can create create an aplcore-like file with

      +2 ⎕nq '.'  'dumpws'  'c:\tmp\mycor.cor'


where c:\tmp\ is an existing directory of your choice.

If you open another instance of Dyalog, you should be able to copy code and other objects from this mycor.cor file.

e.g.
)copy c:\tmp\mycor.cor

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest