newlisp command line option for not loading init.lsp

For the Compleat Fan
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

newlisp command line option for not loading init.lsp

Post by 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
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

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
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

So 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:

Code: Select all

~> 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
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

that's pretty cool!

thanks

Locked