Code: Select all
(load "util/link.lsp")
(link "/usr/bin/newlisp" "my-app" "my-app.lsp")
Inside my-app.lsp
Code: Select all
(load "modules/foo.lsp")
(load "modules/bar.lsp")
Code: Select all
(load "util/link.lsp")
(link "/usr/bin/newlisp" "my-app" "my-app.lsp")
Code: Select all
(load "modules/foo.lsp")
(load "modules/bar.lsp")
Code: Select all
(context 'Foo)
...
...
(context MAIN)
(context 'Bar)
...
...
(context MAIN)
(Foo:this x y z)
(Bar:that p q r)
...
(exit)
Lutz wrote:Yes, the only way is, too merge the modules into one program file, like this:
When you have multiple contexts in one file it is important to finish them them with a switch to MAIN (not necessary to quote, because MAIN exists already).Code: Select all
(context 'Foo) ... ... (context MAIN) (context 'Bar) ... ... (context MAIN) (Foo:this x y z) (Bar:that p q r) ... (exit)
link.lsp just appends the encrypted source file to the newlisp executable. The encryption is trivial, and only serves to deter amateurs from casual fiddling with your source code. But anybody who understands newLISP will be able to extract your source code after reading/understanding the link.lsp file.
cormullion wrote:If you distribute any software, you might have to distribute the source anyway...