-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GRACE_MODULE_PATH does not behave as expected #293
Comments
From the command line, what minigrace ought to do is find files on your If minigrace is not following Providing path names (relative to the importing file) does work at compile time, but can be tricky at runtime. Will the object code correspond to the source code? Other compiled language have the same problem. I honestly can't remember the current status of importing files at runtime when the importing module uses a path. What I know will not work is having two modules with the same file name. |
Nope, chaning
(Using However if I run |
@IsaacOscar, can you please create a test for this issue, and ascertain whether or not it is fixed by Pull Request 296 ? |
Here is a proposal for the semantics of
What about the case of 6. If 7. If 8. The compiler will then search for a moduleName.js file that has been generated from source code with the same Should it also look, for each |
Suppose I have a folder f that contains all my libraries. Hence I will place f in my GRACE_MODULE_PATH. Now for organization reasons, I have two sub-directories, one for my intro class libraries “intro” and the other for my data structures related libraries “ds”. How do I get to the libraries in “intro”?
import “f/intro/mylib”
If that doesn’t work, is there any other way I can get to it without included the complete path (/…)?
This kind of access could be useful if students are working both in lab (on our computers) and their own home machines. They will not have to change the import statements as they move back and forth.
Admittedly I could put all of the needed directories in the path, but this likely would be a useful scenario. Not critical, just useful.
|
If
in the importing module, and have minigrace find the module in Thanks for the use case! I can see that this might be handy. |
This proposal, including allowing absolute paths and paths with slashes, has been implemented in 0cf0402. |
If I have a file
main.grace
And a file
util.grace
(in the same folder)It prints:
Indicating it is using the
util.grace
file from/usr/lib/grace/modules
, and not the local directory.This behaviour has caused me quite some confusion! at the very least I would like a warning so I could tell what was going on. A better option is probably to have some kind of standard prefix, e.g.
platform/util
, like kernan has.The text was updated successfully, but these errors were encountered: