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 11 forks source link

Link docs state Start function creates the name ST but not so in source code #634

Closed rikedyp closed 4 months ago

rikedyp commented 4 months ago

https://dyalog.github.io/link/4.0/Usage/Setup/#automating-startup

The prose claims the name ST is created by the function Start, but nowhere in Start is ST defined. I question the assertion that ST is a more pleasant name than #.stats, although the relocation of modules might have merit. I would say that the top of Main could rather have stats ← #.stats to that a user might write stats.Mean instead of #.stats.Mean, while also a reader of Main being able to understand where stats comes from. Perhaps the whole part about ST should be removed as I don't think it's particularly relevant to the content on that page anyway.

From the doc:

The function linkdemo.Start will bring in the stats library using Link.Import: since we are not developers of this library, we don't want to create a bi-directional link that might allow us to accidentally modify it during our testing. It also creates the name ST to point to the stats library, which means that our Run function can use more pleasant names, like ST.Mean in place of #.stats.Mean - which also makes it easier to relocate that module in the workspace:

     ∇ Start run                                                                       
[1]   ⍝ Establish development environment for the linkdemo application                 
[2]                                                                                    
[3]    ⎕IO←⎕ML←1                                                                       
[4]    ⎕SE.Link.Import '#.stats' '/users/sally/stats' ⍝ Load the stats library
[5]
[6]    :If run                                                                         
[7]        Main                                                                        
[8]        ⎕OFF                                                                        
[9]    :EndIf                                                                          
     ∇