Dyalog / Dyalog/link

How can I link into a non-empty root namespace with v. 3 as I did with v. 2 of Link.

Open
#472 3 comments 0 reactions 0 assignees View on GitHub
discuss H𝗜𝗚𝗛
Dominant language
APL
Stars
26
Forks
11
Avg merge
1d 18h
Merged PRs (30d)
1

Description

**Describe the bug**
I use Link with **flatten** option, hence link into root namespace. After upgrading to v. 3.0.19 of Link it is no longer possible to do in a non empty root namespace.

This is the reported message:

⎕SE.Link.Create: Cannot link a non-empty namespace to a non-empty directory:

I have noticed it was added to documentation, that only empty namespaces was allowed, but is this really what we want?

> dir means that the namespace must be non-existent or empty and will be populated from source files.

**To Reproduce**

)clear
clear ws
'cetestopt'⎕ns''
cetestopt.flatten←1
cetestopt.typeExtensions←1 2 ⍴3 'aplf'
cetestopt.fastLoad←1

path←'c:\repos\tools-global-apl'
cetestopt ⎕SE.Link.Create '#' path
⎕SE.Link.Create: Cannot link a non-empty namespace to a non-empty directory: #.# ←→ c:\repos\tools-global-apl
cetestopt ⎕SE.Link.Create'#'path

⎕se.Link.Version
3.0.19

**Expected behaviour**
I expect to be able to link to root namespace also when it contains variables, functions, etc.

The actual use case is a situation, where I have workspace with an APL application loaded in root and want to include some additional functions to root namespace.

**Session transcript**
See above.

**Desktop (please complete the following information):**
- OS: [Windows]
- APL version: [18.2.45345 Unicode 64-bit]
- `⎕SE.Link.Version`: [3.0.19]

**Additional context**
It seems to work even if root namespace isn't empty. I added a stop in line 44-45 and set emptyns.

cetestopt ⎕SE.Link.Create '#' path

Create[44]
)si
⎕SE.Link.Create[44]*
emptyns
0
emptyns←1
)si
⎕SE.Link.Create[45]*
→⎕LC ⍝
Linked: # ←→ c:\repos\tools-global-apl

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.