aplteam / Tatin

Tatin is a package manager for Dyalog APL
MIT License
25 stars 5 forks source link

Finding assets when a package is opened as a project #127

Closed aplteam closed 1 year ago

aplteam commented 1 year ago

When a Tatin package is loaded, a namespace TatinVars is injected into the package. It contains among other things the configuration as well as a function GetFullPath2AssetsFolder which does what it says.

When the project of such a package is opened with Cider one has to rely on CIDER.HOME instead. That is unfortunate.

Worse, if somebody, for any reason, does not use Cider but brings the code into the WS with LINK then there is not even this workaround available.

Two changes are proposed:

  1. Cider should inject a namespace TatinVars in exactly the same way Tatin does

    The advantage of this is that a programmer can rely on precisely the same environment, no matter whether the package is opened as a project or running as a package.

  2. The Tatin function that establishes TatinVars should be exposed so that by calling it you can get the same result yourself with a single function call.

rikedyp commented 1 year ago

I don't think the Link problem is too bad. I see Cider and Tatin as mechanisms by which a programmer can rely on external assets. If somebody loads code using Link, then they may explicitly specify a directory path, but the code itself internally cannot know from where it was loaded without establishing some convention e.g. "place the code in a folder at the same level as (sibling to) your APLSource folder." These proposals don't seem to address the link issue anyway.

If the idea is to implement only one proposed change, then I prefer option (1) - it's kind of synergistic with Cider config having a tatinFolder.

aplteam commented 1 year ago

Implemented in Cider 0.26.0