From: Sebastian Boldt
Subject: CMUCL
Date: 
Message-ID: <20011130183316.2ae53b97.SebastianBoldt@t-online.de>
Hello ppl,

I do not get ilisp work in my emacs and now I want to compile my lisp programms on the command line. Is this possible at all?? I think
I didn't get the concept...

Thanks...
	...Sebastian

From: ·······@andrew.cmu.edu
Subject: Re: CMUCL
Date: 
Message-ID: <20011130140925.B2173@emu>
On Fri, Nov 30, 2001 at 06:33:16PM +0100, Sebastian Boldt wrote:
> Hello ppl,
> 
> I do not get ilisp work in my emacs and now I want to compile my lisp programms on the command line. Is this possible at all?? I think
> I didn't get the concept...
> 
> Thanks...
> 	...Sebastian

In Emacs, even without ILISP installed, you should be able to do
M-x inferior-lisp and obtain a Lisp toplevel inside of Emacs.  I believe
it assumes the executable name is 'lisp' which is the CMUCL default anyway.

ILISP provides some nicer abilities, however, and you should try to get it
working.

As for compiling, remember that Lisp doesn't assume you're on a system with
a command line even.  Compilation is done from within a running Lisp system,
which lets you use Lisp to define your build system (defsystem comes to mind).
Investigate the COMPILE and COMPILE-FILE functions in the HyperSpec.

-- 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Matthew Danish                         email: ·······@andrew.cmu.edu ;;
;; OpenPGP public key available from:        'finger ···@db.debian.org' ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From: ········@acm.org
Subject: Re: CMUCL
Date: 
Message-ID: <VdSN7.26164$cC5.2947265@news20.bellglobal.com>
Sebastian Boldt <··············@t-online.de> writes:
> I do not get ilisp work in my emacs and now I want to compile my
> lisp programms on the command line. Is this possible at all?? I
> think I didn't get the concept...

This would indeed be kind of neat to figure out.

CLISP offers:
 % clisp -c some-lisp-program.lisp

It's easy enough to write up  a shell script to do this; call it 
compile-cmu, and put, in that file:

#!/bin/sh
# $Id$
# Compile a bunch of CMU Lisp programs
for i in $1 $2 $3 $4 $5 $6 $7 $8; do
  echo "(compile-file \"$i\")" >> /tmp/cf.$$
done
echo "(quit)" >> /tmp/cf.$$
cat /tmp/cf.$$
lisp < /tmp/cf.$$
rm /tmp/cf.$$

Then you can do the command:
% compile-cmu *.lisp
and it'll go off and compile everything (well, up to 8 files;
feel free to extend that!)
-- 
(reverse (concatenate 'string ·············@" "enworbbc"))
http://www.cbbrowne.com/info/linuxdistributions.html
Mental health is overrated!! 
From: ·······@andrew.cmu.edu
Subject: Re: CMUCL
Date: 
Message-ID: <20011130162137.E2173@emu>
On Fri, Nov 30, 2001 at 08:45:41PM +0000, ········@acm.org wrote:
> #!/bin/sh
> # $Id$
> # Compile a bunch of CMU Lisp programs
> for i in $1 $2 $3 $4 $5 $6 $7 $8; do

for i in $*; do

>   echo "(compile-file \"$i\")" >> /tmp/cf.$$
> done
> echo "(quit)" >> /tmp/cf.$$
> cat /tmp/cf.$$  # why?
> lisp < /tmp/cf.$$

lisp -load /tmp/cf.$$

> rm /tmp/cf.$$
> 
> Then you can do the command:
> % compile-cmu *.lisp
> and it'll go off and compile everything (well, up to 8 files;
> feel free to extend that!)

I still think it would be preferable to use defsystem or asdf, however.

-- 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Matthew Danish                         email: ·······@andrew.cmu.edu ;;
;; OpenPGP public key available from:        'finger ···@db.debian.org' ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From: Kaz Kylheku
Subject: Re: CMUCL
Date: 
Message-ID: <h2TN7.10197$nm3.432889@news1.rdc1.bc.home.com>
In article <····················@emu>, ·······@andrew.cmu.edu wrote:
>On Fri, Nov 30, 2001 at 08:45:41PM +0000, ········@acm.org wrote:
>> #!/bin/sh
>> # $Id$
>> # Compile a bunch of CMU Lisp programs
>> for i in $1 $2 $3 $4 $5 $6 $7 $8; do
>
>for i in $*; do

for i in ··@"; do

Not that any Lisp users would be idiotic enough to use spaces
in pathnames, but you never know.
From: Pierre R. Mai
Subject: Re: CMUCL
Date: 
Message-ID: <87g06vubxi.fsf@orion.bln.pmsf.de>
········@acm.org writes:

> Sebastian Boldt <··············@t-online.de> writes:
> > I do not get ilisp work in my emacs and now I want to compile my
> > lisp programms on the command line. Is this possible at all?? I
> > think I didn't get the concept...
> 
> This would indeed be kind of neat to figure out.
> 
> CLISP offers:
>  % clisp -c some-lisp-program.lisp

If that is really something that people wanted, put the following into
your site-init.lisp or ~/.cmucl-init file:

(macrolet ((with-batch-processing (&body body)
             `(handler-case (prog1 t ,@body)
                (serious-condition (condition)
                  (format *error-output* "Error in batch processing:~%~A~%"
		          condition)
                  (finish-output *error-output*)
                  (throw 'lisp::%end-of-the-world 1))
                (:no-error (value)
                  (declare (ignore value))
                  (throw 'lisp::%end-of-the-world 0)))))

(ext:defswitch "compile"
    #'(lambda (switch)
        (with-batch-processing
          (mapc #'compile-file (ext:cmd-switch-words switch)))))

(ext:defswitch "compile-and-load"
    #'(lambda (switch) 
        (with-batch-processing
          (mapc #'(lambda (file) (compile-file file :load t))
                (ext:cmd-switch-words switch)))))

) ; macrolet


Now you can use the following to compile (and load) from the command
line:

lisp -compile-and-load demo.lisp demo2.lisp

If errors are encountered during processing, CMU CL is aborted, with a
return value of 1, otherwise it returns 0 (i.e. success).

This can be combined with the -quiet flag (put it at the start of the
command-line) if wanted.

That said, I don't use anything of the sort, but we use a -process
switch in some of our simulation shells, which takes the given files,
and compiles them into the core (without going through a fasl file),
so that users can load their own code in batch settings, without
having to compile them first, yet still getting compiled performance:

(defun process-switch-demon (switch)
  (let ((files (copy-list (ext:cmd-switch-words switch))))
    (push #'(lambda ()
              (dolist (file files)
                (format *terminal-io*
                        "~&;;; Processing compiled code from ~A.~%" file)
                (with-open-file (s file)
                  (ext:compile-from-stream s))))
          *run-actions*)))

(ext:defswitch "process" #'process-switch-demon)

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: ········@acm.org
Subject: Re: CMUCL
Date: 
Message-ID: <3JfO7.23342$Ju6.4200093@news20.bellglobal.com>
"Pierre R. Mai" <····@acm.org> writes:
> If that is really something that people wanted, put the following into
> your site-init.lisp or ~/.cmucl-init file:

[snip into init.lisp...]

> Now you can use the following to compile (and load) from the command
> line:
> 
> lisp -compile-and-load demo.lisp demo2.lisp

It would probably be better, ultimately, for me to figure out
defsystem; the above provides a way of easily using traditional old
Unix Makefiles to set up dependancies, which isn't to be _completely_
sniffed at.

I'd hardly propose adding the feature to the next revision of ANSI
Common Lisp, but it's useful enough in its way...

Thanks!
-- 
(reverse (concatenate 'string ·············@" "sirhc"))
http://www.cbbrowne.com/info/linux.html
"[In 'Doctor' mode],  I spent a good ten minutes  telling Emacs what I
thought of it.   (The response was, 'Perhaps you could  try to be less
abusive.')"  -- Matt Welsh
From: Nils Goesche
Subject: Re: CMUCL
Date: 
Message-ID: <lkbshjd38e.fsf@pc022.bln.elmeg.de>
Sebastian Boldt <··············@t-online.de> writes:

> I do not get ilisp work in my emacs and now I want to compile my
> lisp programms on the command line. Is this possible at all?? I
> think I didn't get the concept...

Are you using GNU Emacs 21?  ILISP isn't working with it out of the
box.  Somebody mailed me a patch but forbade me to distribute it
because he wanted to make sure that it works properly, first.  Maybe
he'll give it to you, too, if you ask in gnu.emacs.help.  Or fix it
yourself (completer.el).

Regards,
-- 
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9
From: Dr. Edmund Weitz
Subject: Re: CMUCL
Date: 
Message-ID: <m3snavfgre.fsf@bird.agharta.de>
Nils Goesche <······@cartan.de> writes:

> Sebastian Boldt <··············@t-online.de> writes:
> 
> > I do not get ilisp work in my emacs and now I want to compile my
> > lisp programms on the command line. Is this possible at all?? I
> > think I didn't get the concept...
> 
> Are you using GNU Emacs 21?  ILISP isn't working with it out of the
> box.  Somebody mailed me a patch but forbade me to distribute it
> because he wanted to make sure that it works properly, first.  Maybe
> he'll give it to you, too, if you ask in gnu.emacs.help.  Or fix it
> yourself (completer.el).

Or you could use the current CVS version from
<http://sourceforge.net/projects/ilisp/> - it works for me.

Edi.
From: Brian P Templeton
Subject: Re: CMUCL
Date: 
Message-ID: <87elmdl27j.fsf@tunes.org>
Nils Goesche <······@cartan.de> writes:

> Sebastian Boldt <··············@t-online.de> writes:
> 
>> I do not get ilisp work in my emacs and now I want to compile my
>> lisp programms on the command line. Is this possible at all?? I
>> think I didn't get the concept...
> 
> Are you using GNU Emacs 21?  ILISP isn't working with it out of the
> box.  Somebody mailed me a patch but forbade me to distribute it
> because he wanted to make sure that it works properly, first.  Maybe
> he'll give it to you, too, if you ask in gnu.emacs.help.  Or fix it
> yourself (completer.el).
> 
To solve the problems with ILISP, add this to your ~/.emacs:

    (setq ilisp-*prefix-match* t)

*before* you load ILISP.

> Regards,
> -- 
> Nils Goesche
> "Don't ask for whom the <CTRL-G> tolls."
> 
> PGP key ID 0x42B32FC9

hth,
-- 
BPT <···@tunes.org>	    		/"\ ASCII Ribbon Campaign
backronym for Linux:			\ / No HTML or RTF in mail
	Linux Is Not Unix			 X  No MS-Word in mail
Meme plague ;)   --------->		/ \ Respect Open Standards
From: Nils Goesche
Subject: Re: CMUCL
Date: 
Message-ID: <87zo51c8ej.fsf@darkstar.cartan>
Brian P Templeton <···@tunes.org> writes:

> To solve the problems with ILISP, add this to your ~/.emacs:
> 
>     (setq ilisp-*prefix-match* t)
> 
> *before* you load ILISP.

That didn't solve everything for me (I think completion didn't
work anymore); the patch was better.  But I just downloaded the
latest CVS snapshot and it works fine out of the box, at least if
you say (load-library "ilisp") now instead of (load-library
"ilisp-all"), God knows why.

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID 0xC66D6E6F