Dyalog / link

Source code for Link – the built-in component that enables the use of text files as the primary storage mechanism for APL source code
https://dyalog.github.io/link
MIT License
19 stars 10 forks source link

Link worries about unnamed namespaces; it should rather ignore them #476

Closed aplteam closed 11 months ago

aplteam commented 2 years ago

When a function that lives in a Linked namespace creates an unnamed namespace with

ns←⎕ns''

and later on populates that unnamed namespace with a variable named, say, foo, and then attempts to edit this variable with

ns.⎕ed 'foo'

then after making a change one gets this error message:

Link Warning: ⎕SE.Link.OnAfterFix: Not a properly named namespace:  #.parent.[Namespace] 

meaning that Link worries about unnamed namespaces; it should rather ignore them.

]toolS.Version
 Dyalog  18.2.45515 64-bit Unicode, BuildID efffdd11            
 OS      Windows 10 or Windows Server 2016 (10.0.19044) 64-bit  
 Link    3.1.1                                                  
 SALT    2.9                                                    
 UCMD    2.51                                                   
 .NET    .NET Framework 4.8.4470.0                              
 WS      18.2                                                   

(this is my <01989>)

mkromberg commented 11 months ago

During review of the PR including the fix which allowed this, Adam and Morten decided to reject it due to the risk of inadvertently losing code changes. In fact, a new issue #596 was opened to verify that there are not other cases where the use of unnamed namespaces can lead to code loss.

A future configuration option will perhaps allow a user to declare that these warnings can be silenced.

aplteam commented 11 months ago

How somebody can put code into an unnamed namespace and expect it to survive escaped me.

mkromberg commented 11 months ago

Less sophisticated users are not necessarily very aware of the difference between ('myns' ⎕NS '') and (myns←⎕NS ''). Many think that the latter is the new and therefore best way to do things.