Subject: Re: What kind of Lisp should I learn if I want to start programing with Lisp?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 07 Feb 2009 08:47:49 -0600
Newsgroups: comp.lang.lisp,comp.lang.scheme,comp.emacs
Message-ID: <YOGdnfn65-eIAhDUnZ2dnUVZ_gGWnZ2d@speakeasy.net>
Kojak  <nntpspy@janville.Borg.invalid> wrote:
+---------------
| Rob Warnock a écrit :
| > Kojak <nntpspy@janville.Borg.invalid> wrote:
| > > Just for information, since version 1.0.22, SBCL can be use
| > > for scripting too (without need of extra tweak in rc file).
| > 
| > And <http://rpw3.org/hacks/lisp/site-switch-script.lisp> adds
| > easy "#!" scripting of both source and FASL files to CMUCL.
| > [I do *lots* of scripting with CMUCL...  ;-}  ]
| 
| Cheater! I've said "without need of extra tweak in rc file". :-)
+---------------

Then I misunderstood what you meant by "rc file". I assumed
you meant one's own personal "run control" (which is what "rc"
stands for) file in one's home directory, such as "~/.cmucl-init"
is for CMUCL. I can understand not wanting to have to have every user
needing to modify their personal init file just to get scripting.

The "site-switch-script.lisp" file mentioned above, by contrast,
goes in the system library directory, not anyone's home directory,
and thus should be considered an "optional module" installed with
the software. It includes a tweak to the "site-init.lisp" file that
is already there [to grab early control, so that the script's options
(if any) don't get interpreted as CMUCL command-line options]. As such,
it gives the ability to do "#!" scripting to *all* users of CMUCL on
the system, not just one.

If you don't like to do it that way, then just hack the same
thing into the "site-init.lisp" file. Or into the source of CMUCL
itself and recompile. The place to do the latter is in the file
".../src/code/save.lisp", in the function SAVE-LISP, in the LABELS
((%RESTART-LISP ...)), just after the (LOAD SITE-INIT ...) call.
In any case, you need to do it *before* the first call to FIND-SWITCH,
otherwise things can get all messed up if the user types the wrong
thing as command-line args to one of his/her scripts.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607