Loading Scripts with an :Include
Posted: Mon Jan 04, 2016 3:02 pm
For reasons that are "Off Topic" here, I am not a fan of Scripts in Dyalog APL.
When defining a "Class", to get around my dislike of scripts, I define all my methods (functions and operators) in a classic namespace, and then put an ":Include" statement naming the Namespace that holds the methods, in the script.
This works well, the class script contains the class statement, the include statement(s), and the Field declarations, but no methods.
However, when it comes to using LOADing the script into a new workspace, the "]Load" fails with a DOMAIN ERROR.
It appears that the script cannot be incorporated into the workspace if the script contains an ":Include" statement, if the namespace named in the ":Include" does not already exist in the current workspace.
So before I can load a class that contains one or more ":Include"s, I have to know in advance what namespaces have been ":Include"d in the script. But because the script in not loaded in the workspace I cannot open the class up in the APL editor to see which namespaces are missing causing the DOMAIN ERROR.
I note that the same type of problems occurs if the class contains a reference to a base class.
A user command that allows one to "View" a class script without loading it, would be helpful here.
When defining a "Class", to get around my dislike of scripts, I define all my methods (functions and operators) in a classic namespace, and then put an ":Include" statement naming the Namespace that holds the methods, in the script.
This works well, the class script contains the class statement, the include statement(s), and the Field declarations, but no methods.
However, when it comes to using LOADing the script into a new workspace, the "]Load" fails with a DOMAIN ERROR.
It appears that the script cannot be incorporated into the workspace if the script contains an ":Include" statement, if the namespace named in the ":Include" does not already exist in the current workspace.
So before I can load a class that contains one or more ":Include"s, I have to know in advance what namespaces have been ":Include"d in the script. But because the script in not loaded in the workspace I cannot open the class up in the APL editor to see which namespaces are missing causing the DOMAIN ERROR.
I note that the same type of problems occurs if the class contains a reference to a base class.
A user command that allows one to "View" a class script without loading it, would be helpful here.