the-carlisle-group / Acre-Desktop

A simple Dyalog APL IDE plugin that introduces "projects" and allows you to keep your source code in Unicode text files.
MIT License
11 stars 1 forks source link

Taking Liberties with the Dependencies Parameter #197

Closed PaulMansour closed 3 years ago

PaulMansour commented 5 years ago

I have taken the liberty of making Dependencies an array of objects rather a list of strings in my projects. Acre is fine with this if I use -Dependencies=off, which is what I'm doing. Two issues arise.

Issue 1: When opened for tracking, Acre has a reference in []SE to the objects inside the AcreConfig object under #. Refrences between []se and # are always a problem. I think the AcreConfig space is cloned so that it is a real descendant of #, but its children object are not (obviously Phil was not expecting them to be objects:

]aCRETOOLS.openproject c:\APLProjects\PaulMansour\Stats
Please wait - Reading 10 files from .../PaulMansour/Stats/APLSource
#.PaulMansour.Stats
     )save c:\ports\testtemp.dws
Cannot perform operation when # is referenced by session namespace.
⎕SE.acre..._code...dataSpaces...ids...dependencies

When you open with -track=off , there is no problem, as Acre does not keep a ref in []SE.

So I propose all subobjects in the config file are appropriatley cloned to maintain proper parentage (at least to be children #, if not children of the namespace they are accessed from.

Issue 2: Acre is fairly lenient here, and letting me do what I want, but obviously this is not a good long term solution.

I propose that Acre accepts an array of namespaces/objects for the Dependencies parameter, and if an array of spaces is provided Acre looks for the Name property in each space, and uses that. In other words, if a string is provided it is the name of the dependency, but if a namespace is provided, then the Name property contains the name of the dependecny.

PhilLast commented 5 years ago
  1. There is no easy way to do a deep clone but believe it or not ⎕SE.acre.(FromAPLAN ToAPLAN) is exactly that for a nested parameter space because it's already doing all the recursive stuff that it needs. Of course there are lower level tools within acre to do it that I can plug in that can be available next commit or release if necessary.
  2. The current format of each item of the config-parm Dependencies is not just the project name (folder) but the entire string that follows the first blank in ]openproject ... including an optional target space and any appropriate options: -track=, -dependencies= ...

e.g. Dependencies←'.../Project2 #.space2 -track=on' '.../Project3 -dependencies=off'

I don't know if that feature is used anywhere other than in the acre test suite but it would need to be emulated if anyone thinks it's necessary.

PaulMansour commented 3 years ago

Obsolete Issue