How to make load chain properly?

Q&A's, tips, howto's
Locked
denis
Posts: 20
Joined: Wed Apr 27, 2011 12:19 pm
Location: Petsamo, Murmansk, RU

How to make load chain properly?

Post 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?

Locked