Subject: Re: Separate the lisp environment from the shell (and other things)
From: rpw3@rpw3.org (Rob Warnock)
Date: Mon, 26 May 2008 04:23:15 -0500
Newsgroups: comp.lang.lisp
Message-ID: <PImdnZ2fg50eHKfVnZ2dnUVZ_jWdnZ2d@speakeasy.net>
Rares Marian  <rares.marian@gmail.com> wrote:
+---------------
| We should be at a point where we can start lisp programs
| from the shell or desktop just like any other binary.
+---------------

Been there, done that, years & years ago. Works just fine:

    $ iota 10
    0 1 2 3 4 5 6 7 8 9
    $ iota 10 20
    20 21 22 23 24 25 26 27 28 29
    $ iota 10 20 5
    20 25 30 35 40 45 50 55 60 65
    $ cat `which iota`
    #!/usr/local/bin/cmucl -script

    (defun iota (count &optional (start 0) (step 1))
      (loop repeat count for i from start by step collect i))

    (format t "~{~a~^ ~}~%"
	      (apply 'iota (mapcar #'read-from-string *script-args*)))
    $ 


-Rob

p.s. See <http://rpw3.org/hacks/lisp/site-switch-script.lisp>
if you use CMUCL and haven't hacked your own "-script" or equiv.

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