{HOME], [DYALOG], and [SALT]

No need to worry about going "off topic" here
Forum rules
This forum is for general chit-chat, not necessarily APL-related. However, it's not for spam or for offensive or illegal comments.

{HOME], [DYALOG], and [SALT]

Postby ray on Fri Jul 27, 2018 12:26 pm

Hi,

I have noticed that under Dyalog 17.0 (under WINDOWS 7 and 10), in some of the file names that occur in the Configuration settings (and hence windows registry) contain what appear to be "shortcuts" for some directory paths.

EG
C:\Users\Ray\Documents\Dyalog APL-64 17.0 Unicode Files\Code;[DYALOG]\Library\Core;[DYALOG]\Library\Conga;[SALT]

and
[SALT]\Spice;[HOME]\Documents\MyUCMDs

Where are these "shortcuts" defined?
Are they part of Windows OS, or Dyalog?

I am assuming these are NOT related to "System operations" (such as "[WSClear]", "[WSLoad]" and "[Off]") that Dyalog also supports.

Thanks for any feedback.

Ray
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 238
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: {HOME], [DYALOG], and [SALT]

Postby Adam|Dyalog on Mon Jul 30, 2018 8:20 am

These are recognised by SALT whenever a path is given. Any phrase in square brackets is replaced with the environment variable of that (for non-Windows: uppercased) name.

Technical details:
It is ⎕SE.SALTUtils.specialName which does this. You can test it with ⎕SE.SALTUtils.specialName'[home]'
User avatar
Adam|Dyalog
 
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm

Re: {HOME], [DYALOG], and [SALT]

Postby ray on Mon Jul 30, 2018 3:42 pm

Thanks for this information.
So:
Code: Select all
       ⎕SE.SALTUtils.specialName'[HOME]'
\Users\Ray

       ⎕SE.SALTUtils.specialName'[DYALOG]'
C:\Program Files\Dyalog\Dyalog APL-64 17.0 Unicode

       ⎕SE.SALTUtils.specialName'[HOME]'
\Users\Ray


Having looked at the code, and I notice that [USER] is also a special name, but does not appear to currently be in use (that is to say, I have not found it in my registry entries).

However when I tried USER it fails:
Code: Select all
         ⎕SE.SALTUtils.specialName'[USER]'
SYNTAX ERROR: Can't change nameclass on assignment
getEnvir[9] r←{0::⎕AN ⋄ (1↓2⊃'\'∘={⎕ML←1 ⋄ ⍺⊂⍵}⊢)2⊃4070⌶⍬}
             ∧


I believe the problem that line [9] is missing an argument of some sort, EG
Code: Select all
getEnvir[9] r←{0::⎕AN ⋄ (1↓2⊃'\'∘={⎕ML←1 ⋄ ⍺⊂⍵}⊢)2⊃4070⌶⍬}⍬


Without it, line 9 is trying to reassign the variable "r" (already defined on line 4) as as a function.

Code: Select all
      r←{0::⎕AN ⋄ (1↓2⊃'\'∘={⎕ML←1 ⋄ ⍺⊂⍵}⊢)2⊃4070⌶⍬}⍬
      r
Ray
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
ray
 
Posts: 238
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: {HOME], [DYALOG], and [SALT]

Postby Adam|Dyalog on Mon Jul 30, 2018 4:29 pm

Thank you for that. I've fixed it and it should become part of the first upcoming patch and eventually make it to https://www.dyalog.com/tools/user-commands.htm as well.
User avatar
Adam|Dyalog
 
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm


Return to Chat

Who is online

Users browsing this forum: No registered users and 1 guest