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

Unhelpful error messages in Refresh and List, perhaps others #179

Closed bernecky closed 3 years ago

bernecky commented 3 years ago

/tmp/crud has: crud.aplf goo.aplf hoo.aplf

Namespace ns has: )fns foo goo hoo
)vars xx

I want to get xx into /tmp/crud, get foo.aplf crud.aplf into ns, and resolve any differences between goo and hoo, either direction. I tried these, with no luck:

 ]LINK.refresh ns -source=dir
* Command Execution Failed: LENGTH ERROR
      ]LINK.refresh #.ns -source=dir
* Command Execution Failed: LENGTH ERROR
      ]LINK.refresh #.ns -source=dir
* Command Execution Failed: LENGTH ERROR
      )fns
foo     goo     hoo     
      ⎕vr'hoo'
     ∇ hoo←{⍝fumble
[1]        ⌽⍵
[2]    }
     ∇

      ]link.list
 Namespace  Directory  Items 
 #.ns       /tmp/crud      0 

Question:   Why is item count zero?  

      ]link.list #
      ]link.list ns
 Namespace  Directory  Items 
 #.ns       /tmp/crud      0

Question: Why do these fail?

* Command Execution Failed: too many arguments
      ]link.list # extended=1
* Command Execution Failed: too many arguments
      ]link.list # extended=0
* Command Execution Failed: too many arguments
      ]link.list  extended=0
* Command Execution Failed: DOMAIN ERROR
      ]link.list  extended=1
* Command Execution Failed: DOMAIN ERROR

      )fns
foo     goo     hoo     
      )vars
xx      
abrudz commented 3 years ago

Thank you for this report. It'd be even more useful if you included your Link version number: ⎕SE.Link.Version

About the "Question: Why do these fail?":

User commands take optional settings using a leading dash (minus) followed by the setting name and then equals and a value:

      ]link.list # -extended=0

Without the dash, extended=0 is taken as an argument, which is then excessive (List takes no more than one argument) or faulty (a namespace name cannot contain =).

bernecky commented 3 years ago

Thanks, Adam,

BTW, I am running Ubuntu 20.10, under Plasma. A few things on docn, which I think would benefit from a view from above:

  1. The Link docs appear not to be standalone, which I think is why you had to tell me about the -extended sort of thing. I would like to be able to use Link without having to study all the ]xxx lore, and a sentence or two at the top of the docs would make that a lot easier.

  2. Each of the verbs, e.g., ]Link.create would be improved, I think, if they started at the top with a one- or two-line precis of their purpose in life.

  3. Each of the verbs would be better if the arguments were shown at the top of the page with their definition and options. E.g., "Link.Create namespace directory -option1=xx -option2=yy..."

  4. Circular definitions rarely help, even when they are not circular definitions. The docn starts off with:

    "Link facilitates the use of text files for APL source code through the creation of one or more links ..."

    To me, it reads like "matrix inverse computes the matrix inverse of..."

Perhaps starting with a clear and concise definition of "link" would help. The very name "link" misleads people, due to it being confused with soft and hard links in unix systems. I looked at the overview; it mentions a "map", but does not provide a definition of what "map" means.

Dyalog APL/S-64 Version 18.0.38525
Serial number: UNREGISTERED - not for commercial use
+-----------------------------------------------------------------+
| Dyalog is free for non-commercial use but is not free software. |
| A non-commercial licence can be used for experiments and        |
| proof of concept until the point in time that it is of value.   |
| For further information visit                                   |
| https://www.dyalog.com/prices-and-licences.htm                  |
+-----------------------------------------------------------------+
Fri Nov 27 09:13:05 2020

      ⎕SE.Link.Version
2.0.2
nicolas-dyalog commented 3 years ago

Fixed in link v2.1 (currently still in the master branch)

bernecky commented 3 years ago

Thanks, Nic,

I'll try it shortly.

Bob

On 2020-12-07 9:36 a.m., nicolas-dyalog wrote:

Closed #179 https://github.com/Dyalog/link/issues/179.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dyalog/link/issues/179#event-4079958425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFTLALVVKCQPSNAWI334OCDSTTR5JANCNFSM4UEL5HPA.

-- Robert Bernecky Snake Island Research Inc 18 Fifth Street Ward's Island Toronto, Ontario M5J 2B9

bernecky@snakeisland.com tel: +1 416 203 0854 text/cell: +1 416 996 4286