If several functions are stored as text files, is there a way to fix all of them to the workspace in one command? I have been fixing files to the workspace one at a time using the editor, i.e., edit text file then fix. However, there should be a way to fix several text files to the workspace in one command. For example consider three files: func1.dyalog func2.dyalog func3dyalog .
Thanks for your help with this.
Fix Multiple Text Files to a Workspace
-
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Fix Multiple Text Files to a Workspace
⍝ This is one way...
⎕← 2 ⎕FIX¨(⊂'file://'),¨'func1.dyalog' 'func2.dyalog' 'func3.dyalog'
⎕← 2 ⎕FIX¨(⊂'file://'),¨'func1.dyalog' 'func2.dyalog' 'func3.dyalog'
-
- Posts: 439
- Joined: Wed Oct 01, 2008 9:39 am
Re: Fix Multiple Text Files to a Workspace
Hi,
If you are using 18.0 or beta 18.2, you can use Link.
There is documentation here:
https://dyalog.github.io/link/3.0/
With Link, I can create a link between # and a directory on disk with:
This brings in APL functions in .dyalog or .aplf files into # in the current workspace.
Regards,
Vince
If you are using 18.0 or beta 18.2, you can use Link.
There is documentation here:
https://dyalog.github.io/link/3.0/
With Link, I can create a link between # and a directory on disk with:
]link.create # C:\mydir
This brings in APL functions in .dyalog or .aplf files into # in the current workspace.
Regards,
Vince
-
- Posts: 22
- Joined: Fri Aug 11, 2017 2:17 pm
Re: Fix Multiple Text Files to a Workspace
Peter and Vince: Thank you for the responses. I am using version 18.0 and will review the documentation that you mention.
-
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Fix Multiple Text Files to a Workspace
Or, as a utility:
Code: Select all
Load←{
fis←(⊂'file://'),¨⍵,¨⊂'.dyalog'
2 ⎕FIX¨fis
}
Re: Fix Multiple Text Files to a Workspace
You could probably use a "⊆" (enclose if simple) in there somewhere so it can be used with a single name as a string.petermsiegel wrote:Load←{
fis←(⊂'file://'),¨⍵,¨⊂'.dyalog'
2 ⎕FIX¨fis
}
-
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Fix Multiple Text Files to a Workspace
Duh. How easy it is (for me) to forget the newer primitives.
Thanks!
Thanks!
Last edited by petermsiegel on Tue Dec 14, 2021 5:09 am, edited 1 time in total.
-
- Posts: 22
- Joined: Fri Aug 11, 2017 2:17 pm
Re: Fix Multiple Text Files to a Workspace
Thanks to all for the very useful comments. The methods mentioned will make assembling a workspace from functions stored as text files much easier. No doubt it will help others as well.
The method using ]link.create # will have to wait until I have time to review the documentation.
Alan
Belgrade, Montana, USA
The method using ]link.create # will have to wait until I have time to review the documentation.
Alan
Belgrade, Montana, USA
-
- Posts: 431
- Joined: Fri Oct 03, 2008 4:14 pm
Re: Fix Multiple Text Files to a Workspace
REMINGTON30 wrote:Alan
Belgrade, Montana, USA
Wow, another APLer in Montana! Who knew? I'm in Bozeman. Having an APL moot (informal gathering for fellowship, coding, eating and drinking, etc.) in early January with some out-of-town APLers. Send me an email to paul@carlislegroup.com if you would like to stop in for an afternoon/evening.
If weather permits, we will be hitting Logan for an afternoon of outdoor activity at the
(⌈/-⌊/)and then Land of Magic or Sir Scotts.