Import question
Monkey Forums/Monkey Programming/Import question
| ||
If I Import a file that does not exist, should an error be thrown? |
| ||
If you import a module that doesn't exist, you'll get a message highlighting this fact. It's just a warning, so the program will compile if the functionality from them missing module wasn't directly used. You can check if a module was imported by using the preprocessor to define an "implementation variable" normally. The result is a variable being defined if the import was successful, meaning you can check if a module exists. |
| ||
No warning is given from what I see (v83b) (debug on). If you tried to use anything from inside the import elsewhere in your program, then that generally gives you a error. I just spent far too long scratching my head over this error, turns out I made a boob on the Import line. I think it would be much wiser to halt compiling if something you are importing is does not exist. |
| ||
Linker halts are a curse; if Trans doesn't spit out a warning already, then a warning sounds like it would be sufficient to solve this.... |
| ||
Logging as a bug! |
| ||
I never knew this problem even existed. I agree it's a bug. |