I suggested something in the other topic, but I had no comments... I really would like to have your opinion about this before releasing CPLua 0.9 :
is the same as
because there is no package in CPLua called "mylib", and thus it searches in the "main" folder if no folder is specified.
I just thought that it would perhaps be easier if CPLua searched in the folder of the file that calls require()
. To be more precise:
Suppose you have a folder "Fol" with 2 files A and B.
If the file A requires the file B, you will have to write
at the beginning of file A. My suggestion is that
is equivalent to
because A is in the folder "Fol". I think it would be easier if you want to rename folders etc, then you wouldn't have to change all the paths.
Note: if you call require()
from a new file (not saved), and if no folder is specified, CPLua would then look in the "main" folder.