How to make load chain properly?

Q&A's, tips, howto's

How to make load chain properly?

Postby denis » Sun Nov 18, 2012 7:05 pm

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?
Posts: 20
Joined: Wed Apr 27, 2011 12:19 pm
Location: Petsamo, Murmansk, RU

Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest