Hi Christopher

> I could install all my supporting files in @lib/ in the picolisp installation 
> directory.
That is one way to do it. Alex usually does it this way afaik.

You could also create your own custom directory within the picolisp directory 
and then refer to it with "@myDirectory/my-lib.l".

The argument(s) to (load) don't have to start with "@".
So you could also load from absolute paths, e.g.:
-  (load "/home/user/programname/foo.l"))
-  (load (pack *Prefix "/share/programname/foo.l"))

The current directory is not changed during executing of (load), so if the 
loaded files refer to additional files, those paths should also be absolute.
You can find out the current directory your program is executing in with (pwd) 
-> this is the start point for relative paths.

There are also:
- (cd "/home/user/programname") -> change the current directory permanently
- or (chdir) to change the directory just for some 'prgs, e.g. (chdir 
"/home/user/programname") (load "foo.l"))

In my installations I always execute the program in it's own directory or 
switch to that directy with (cd), and I load all includes from relative paths.

Best regards,
beneroth


----- Original Message -----
From: Christopher Howard [mailto:christopher.how...@qlfiles.net]
To: picolisp@software-lab.de
Sent: Sat, 02 Sep 2017 07:47:42 -0800
Subject: Installation / Load Paths

Hi, what is the customary way PicoLisp programmers deal with load path
issues when trying to install a completed program onto a Gnu/Linux
system? My program has two *.l files. What I wanted to do was:

- Put the *.l files in $(PREFIX)/share/programname/
- Have a bash or picolisp script in $(PREFIX)/bin that starts the
program in $(PREFIX)/share/programname.
- Preferably do all this without having to modify the callers CWD.

This creates some difficulties because one of the source files simply
does a (load "myothermodule.l"), which works great when running from
the source directory, but not when installed somewhere outside the CWD.
Do I need to change that to (load "@myothermodule.l) and modify the @
variable somehow during invocation? Or I guess I could install all my
supporting files in @lib/ in the picolisp installation directory.

Or is there some other "load-path" mechanism in picolisp I'm not
seeing...?

--
https://qlfiles.net
https://emailselfdefense.fsf.org/en/


Reply via email to