|Newbie questions about Pliant
importing a module or a .pli in the current directory
How do I import a module or .pli file that exists in or under the
same directory, outside the Pliant filesystem?
|Message posted by mujtaba on 2003/04/29 17:40:13
|How do I import a module or .pli file that exists in or under the
same directory, outside the Pliant filesystem? Let say,
I have functions in funcs.pli and a main program in main.pli.
They are in a directory outside the Pliant path. How can I
import funcs.pli into main.pli? Doing a 'module "funcs.pli"'
|Message posted by reitman on 2003/04/29 20:47:23
|Are you using the public keyword ?
Public on its own line at the top of your funcs.pli file
|Message posted by mujtaba on 2003/04/29 21:23:37
|No, I don't think thats my problem. I get a "Failed to load module" error.
Were you successful doing something like this? I think Pliant requires
absolute paths from under the /pliant tree. Or maybe I'm not doing something
|Message posted by michel on 2003/04/30 09:09:26
|Just a question :
What is your operating system ?
|Message posted by mujtaba on 2003/04/30 13:53:36
|Linux. Why? Should I be able to include modules the way I describe?
I would appreciate it if any you would describe in detail how you
were able to accomplish this:
I have in my home directory, two .pli files:
import "hellofn.pli" #hellofn.pli is in the same directory
console "Hello World!" eol
The only way I can get this trivial example to work is by
moving the hello directory in $HOME/pliant/pliant/ and
changing the test.pli to:
But if any of you get this to work outside the pliant tree,
I would appreciate it much.
|Message posted by michel on 2003/04/30 15:28:25
|The best thing you can do with Linux is to make a symbolic link between, for exemple : /pliant/home (absolute path ) and $HOME and to launch install one time more.
It works on my computer.
|Message posted by hubert.tonneau on 2003/05/01 10:23:51
|First of all, if you specify a module name with no leading slash in 'module'
instruction, the path will be the path of the current module, not the current
operating system level path.
Second, the high level 'module' instruction will not let fetch files outside
Now the low level 'pliant_load_module' instruction will let you do it, but it
needs more work to use and is not at all for anybody except expert Pliant
Anyway, the 'pliant_load_module' function is defined as C function 'load_module'