From ... Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!reader3.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: hallo world in lisp References: <3B9DEE6F.F8100585@mpq.mpg.de> Mail-Copies-To: never From: Erik Naggum Message-ID: <3209203870489803@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 58 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 11 Sep 2001 13:31:13 GMT X-Complaints-To: newsmaster@Norway.EU.net X-Trace: reader3.kpnqwest.net 1000215073 193.71.66.49 (Tue, 11 Sep 2001 15:31:13 MET DST) NNTP-Posting-Date: Tue, 11 Sep 2001 15:31:13 MET DST Xref: archiver1.google.com comp.lang.lisp:16148 * Luciano Ribichini > I use Linux (kernel 2.2.x) Which distribution? > I would like to try the LISP language. Good! > Can you tell me where to find a free/GLP lisp (interpreter, compiler or > what else) and how to run the lisp variant of the famuos hallo world! > c-program? If you use Debian GNU/Linux, just apt-get install cmucl or clisp. The famous C program is famous for its ablity to produce an executable with a minimal amount of fuss. It really shows off the Unix environment, and not the language. However, an executable is only a funtcion that resides on disk in the Unix file sysem and which you call from the shell's read-execute interactive loop. Common Lisp systems offer their own interactive loop, called the read-eval-print loop and do not generally take part in the shell interactive loop the same way other languages do. Some find this a insurmountable obstacle to using Common Lisp, others love it. However, the code for the core program is simple: (defun hello-world () (write-line "Hello, Lisp world!")) Suppose you put this in a file, hello.cl. To compile it, evaluate (compile "hello.cl") You now have an object file that can be loaded into the Common Lisp system: (load "hello") You are now ready to execute the hello-world function: (hello-world) If you want to run an "executable" from the shell interactive loop, there are many ways to accomplish this, but no standard way. Suppose you use CLISP and have a Linux kernel with misc-binaries support you can do this, as root: echo ":CLISP:E::fas::/usr/bin/clisp:" >> /proc/sys/fs/binfmt_misc/register echo ":CLISP:E::lisp::/usr/bin/clisp:" >> /proc/sys/fs/binfmt_misc/register You can now actually just write (write-line "hello, Lisp world!") into the file hello.lisp and chmod +x hello.lisp and execute it directly. Note that you would have to add (hello-world) at the end of the hello.cl file I indicated above to execute anything. ///