New to NewLISP. Also new to writing code that needs to be compiled and linked [1]
From the manual, '23. Linking newLISP source and executable" I find that to compile/link I need a copy of link.lsp and newlisp in the same directory. Experimenting, I see symbolic links will serve the same purpose.
Now, before I hack up a bash script to create symbolic links in any given directory I want to compile in .. is there a better way to get 'link.lsp' and newlisp to the directory where the code is? An already existing script?
~brian
[1] Last time I did anything like compiling and linking [2] was with Clipper Summer of '87, in 1991. Which was an extension language for dBase III. So we're talking a super-long time ago.
[2] Not counting using gcc to compile and etc another's code.
Unix - Linking newLISP source and executable - newbie query
Re: Unix - Linking newLISP source and executable - newbie qu
Can you try this?
Code: Select all
newlisp /path/to/link.lsp
(link "newlisp" "your-exe-name" "your_newlisp_script.lsp")
Re: Unix - Linking newLISP source and executable - newbie qu
Code: Select all
$ ls
uppercase.lsp
$ newlisp /usr/share/newlisp/util/link.lsp
newLISP v.10.3.3 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.
> (link "newlisp" "uppercase" "uppercase.lsp")
original newlisp executable:newlisp
new executable:uppercase
source:uppercase.lsp
ERR: array, list or string expected : (file-info orgExe)
called from user defined function link
Re: Unix - Linking newLISP source and executable - newbie qu
I lifted uppercase.lsp from the docs - but I don't think it's the problem?
Code: Select all
$ cat uppercase.lsp
:: uppercase.lsp - Link example
(println (upper-case (main-args 1)))
(exit)
$
Re: Unix - Linking newLISP source and executable - newbie qu
Hmm, I don't remember seeing the error before.
However can you add the pathname for the newlisp executable in your repl.
If that fails too, you may copy the newlisp executable to your script path.
Cheers!
However can you add the pathname for the newlisp executable in your repl.
Code: Select all
newlisp /path/to/link.lsp
(link "/path/to/newlisp executable" "uppercase" "uppercase.lsp")
Cheers!
Re: Unix - Linking newLISP source and executable - newbie qu
OS X 10.6.8Hmm, I don't remember seeing the error before.
Installed using the package
Nothing out of the ordinary about the system or what I've done to it, that I can think of.
So I can!However can you add the pathname for the newlisp executable in your repl.
Code: Select all
$ cat uppercase.lsp
:: uppercase.lsp - Link example
(println (upper-case (main-args 1)))
(exit)
$ which newlisp
/usr/bin/newlisp
$ newlisp /usr/share/newlisp/util/link.lsp
newLISP v.10.3.3 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.
> (link "/usr/bin/newlisp" "uppercase" "uppercase.lsp")
original newlisp executable:/usr/bin/newlisp
new executable:uppercase
source:uppercase.lsp
true
> (exit)
$ chmod +x uppercase
$ ./uppercase foo
FOO
$