newlisp command line option for not loading init.lsp

Started by cormullion, May 14, 2007, 01:35:09 PM

Previous topic - Next topic

cormullion

As I put more things into init.lsp for interactive work (eg documentation, debugging, short-cuts), it occurs to me that I want to have this run only when using newLISP interactively.



So is there a way of starting newlisp without running init.lsp? It seems like it would be a switch that you use when you run newlisp programs that aren't going to be an interactive terminal session. They'd be quicker and cleaner... Then, on the other hand, when you start newlisp 'normally', you'd automatically load up lots of convenient goodies that make interactive sessions easier...

Dmi

#1
probably the better way is to call

$ newlisp init1.lsp

(or the same with a shell script)

when U want interactive stuff to be loaded and to put all of it into init1.lsp.



So U'll be able to leave all essential stuff in init.lsp
WBR, Dmi

cormullion

#2
Hi Dmitri! yes, your suggestion is good ...



...  I just thought it more logical to have init.lsp stuff loaded when you type newlisp in a terminal, but to have it excluded when you run files using the #!/usr/bin/newlisp... line (eg as  a subprocess in an editor or as a daemon...).



.. no problem though

Lutz

#3
QuoteSo is there a way of starting newlisp without running init.lsp?


You can make yourself quickly a newlisp which doesn't call init.lsp. All linked newlisp programs (see file:///usr/share/doc/newlisp/newlisp_manual.html#linking ) do not call init.lsp.



This is what you do in a terminal shell on Mac OSX or any other UNIX:




~> touch empty.lsp
~> sudo newlisp /usr/share/newlisp/link.lsp
Password:
newLISP v.9.1.5 on OSX UTF-8, execute 'newlisp -h' for more info.

> (link "/usr/bin/newlisp" "/usr/bin/rawnewlisp" "empty.lsp")
true
> (exit)
~> sudo chmod 755 /usr/bin/rawnewlisp
~> rawnewlisp


- make an empty program empty.lsp

- start newlisp in administrator mode using sudo and load the link program

- do the linking and create a new newlisp executable called: rawnewlisp

- exit newlisp

- give the newly created program executable permissions

- run you new rawnewlisp



You also could put some special startup lisp into empty.lsp.



Lutz

cormullion

#4
that's pretty cool!



thanks