Page 1 of 1

How to make load chain properly?

Posted: Sun Nov 18, 2012 7:05 pm
by denis
Hi again, folks!

Tried to find the info in documentation and other forum topics but couldn't.

The question is about load function.

Say I have three files: main.lsp, lib/a.lsp, lib/b.lsp

How do I load file b.lsp into a.lsp if i load a.lsp into main.lsp?

This doesn't work:

Code: Select all

; main.lsp:
(load "lib/a.lsp")

; a.lsp:
(load "b.lsp")
because current directory is defined by the directory where main.lsp resides, not the file being loaded.
I don't want to write absolute path as all files il lib directory can constitute a single library, and the lib directory can take arbitrary location in the local filesystem.

Is there some way to load b to a, however?