From: sundar
Subject: VERY elementary SLIME questions
Date: 
Message-ID: <1144603877.746150.284520@i40g2000cwc.googlegroups.com>
Hi all, I'm new to Common LISP itself, to EMACS, to Ubuntu(on which I'm
using EMACS), and to SLIME. I think you can imagine how much of a
newbie I am. :-)
I installed Emacs from the Ubuntu Hoary Hedgehog CD. Then I very
recently added SLIME to it from slime-1.2.1.tar.gz. I extracted it to
my home folder and then created a .emacs file there. I added the lines
given in the README file in the archive to this .emacs(correcting the
path).
Now, I would like to know how I should compile a Common LISP file I
create and what kind of output it would create(of course, that would
depend on my program, but I want an idea of things like whether there
will be a pop-up window or whether it will go to console, etc.). The
SLIME manual lists C-c C-k for "Compile and load the current buffer's
source file", but when I try that in a valid LISP file (I downloaded it
from the net), it says "Not connected" in the Echo area. In fact, it
says the same thing even when I try to evaluate single lines in the
'scratch' buffer. Is it that it tries to connect to some other
computer? If so, how do I tell it that mine is stand-alone? Is it
needed that my PC be connected to the thing people call a  "Lisp
machine"?
Also, I haven't yet managed how to use REPL in Emacs, so please help me
find that one too. Thanks for your patience...

From: Ari Johnson
Subject: Re: VERY elementary SLIME questions
Date: 
Message-ID: <44394ad2$0$15788$14726298@news.sunsite.dk>
sundar wrote:
> Hi all, I'm new to Common LISP itself, to EMACS, to Ubuntu(on which I'm
> using EMACS), and to SLIME. I think you can imagine how much of a
> newbie I am. :-)
> I installed Emacs from the Ubuntu Hoary Hedgehog CD. Then I very
> recently added SLIME to it from slime-1.2.1.tar.gz. I extracted it to
> my home folder and then created a .emacs file there. I added the lines
> given in the README file in the archive to this .emacs(correcting the
> path).
> Now, I would like to know how I should compile a Common LISP file I
> create and what kind of output it would create(of course, that would
> depend on my program, but I want an idea of things like whether there
> will be a pop-up window or whether it will go to console, etc.). The
> SLIME manual lists C-c C-k for "Compile and load the current buffer's
> source file", but when I try that in a valid LISP file (I downloaded it
> from the net), it says "Not connected" in the Echo area. In fact, it
> says the same thing even when I try to evaluate single lines in the
> 'scratch' buffer. Is it that it tries to connect to some other
> computer? If so, how do I tell it that mine is stand-alone? Is it
> needed that my PC be connected to the thing people call a  "Lisp
> machine"?
> Also, I haven't yet managed how to use REPL in Emacs, so please help me
> find that one too. Thanks for your patience...
> 

Type this to start up SLIME, including a Lisp process for it to 
automatically connect to on your own machine:
M-x slime RET

This assumes that you have installed a Lisp and configured SLIME to use 
it.  The relevant portion of my .emacs on my Debian machine is:
;;; SLIME
(setq inferior-lisp-program "sbcl") ; change if using clisp or cmucl
(setq slime-startup-animation nil) ; personal preference
(setq slime-kill-without-query-p t) ; to quit emacs faster
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/slime")
(require 'slime)
(slime-setup :autodoc t)
(add-hook 'slime-mode-hook ; this part makes SLIME start if I open a
   '(lambda ()              ; .lisp file and it's not already running
      (show-paren-mode t)
      (unless (slime-connected-p)
        (save-excursion (slime)))))
(add-hook 'sldb-hook 'sldb-print-condition)
From: Harald Hanche-Olsen
Subject: Re: VERY elementary SLIME questions
Date: 
Message-ID: <pcozmiuy6y9.fsf@shuttle.math.ntnu.no>
+ "sundar" <················@gmail.com>:

| Hi all, I'm new to Common LISP itself, to EMACS, to Ubuntu(on which
| I'm using EMACS), and to SLIME. I think you can imagine how much of
| a newbie I am. :-)

Yes, we can tell from the way you are using all CAPITALS for words
like Lisp, emacs and slime ...

| I installed Emacs from the Ubuntu Hoary Hedgehog CD. Then I very
| recently added SLIME to it from slime-1.2.1.tar.gz.

Ah, but from the below it is clear that you have not added the most
crucial ingredient:  A Lisp system.  I have no idea which one is
easiest to install on Ubuntu, but I can certainly recommend SBCL.
http://sbcl.sourceforge.net/ if it doesn't come prepackaged for your
system.

| Now, I would like to know how I should compile a Common LISP file I
| create and what kind of output it would create

Don't worry about file compilation yet.  Get to learn the language
first.  Type stuff into the REPL (that is the read-eval-print loop),
make lisp files and load them, but let compilation wait until you
really need it.  It's going to take a while.

And speaking of learning Lisp, if you aren't already aware of it there
is no better place to start than here:

  http://gigamonkeys.com/book/

If you find after a while that Lisp is for you, then buy the paper
edition of course.  Good luck!

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
From: Christian Haselbach
Subject: Re: VERY elementary SLIME questions
Date: 
Message-ID: <e1bihs$di6$1@online.de>
sundar worte:
> Hi all, I'm new to Common LISP itself, to EMACS, to Ubuntu(on which I'm
> using EMACS), and to SLIME. I think you can imagine how much of a
> newbie I am. :-)

As an Ubuntu user you may want to add the following to your 
/etc/apt/sources.list:
deb http://people.debian.org/~pvaneynd/cl-breezy-packages ./
Up-to-date slime and sbcl can be found here. Sbcl is an open source 
common lisp system which I like so far. I cannot comment on other lisp 
systems.

However, I cannot recommend installing cl-* packages. At least not if 
you try to use ucw. In this case it is better to download the packages 
yourself and symlink the asd files into your lisp system directory.
Well, this worked for me.

> Also, I haven't yet managed how to use REPL in Emacs, so please help me
> find that one too. Thanks for your patience...

If you have installed slime and sbcl, write the following in ~/.emacs
(setq inferior-lisp-program "/usr/bin/sbcl")
(require 'slime)
(slime-setup)

The first line tells emacs which lisp system to use (by pointing it to 
an executable), the rest sets up slime.
Now start emacs, press M-x (Meta/Alt and x) and type slime[ENTER].
After a while you should get a prompt, there you have your REPL.
Now you can eddit your own lisp file and evaluate (parts of) it using 
the slime menu.

If you want to use a lisp REPL outside emacs, just open a terminal and 
call sbcl.

Regards,
Christian
From: senator
Subject: Re: VERY elementary SLIME questions
Date: 
Message-ID: <1144634042.313436.216250@i40g2000cwc.googlegroups.com>
I installed Ubuntu 5.10 recently too, and having played a bit before
with Slime/clisp/Emacs on Mandriva, found the setup quite
straightforward. clisp and Emacs are both installable from that
Synaptic package manager (that means you can start straight away (just
type "clisp") at the command prompt REPL of clisp, even without Slime -
that way you know immediately which parts are working). I think I had
to get Slime off CVS. Additionally, after a month or two (depending on
how much you code), it might be good to start using the structured
editing package paredit.el.

You need to also be aware that Emacs itself has a lisp, but this
Emacs-Lisp is not Common Lisp. So if you evaluate things in *scratch* -
it goes to Emacs Lisp. In *slime-scratch*, it goes to your Common Lisp.
When successfully connected, the CL  REPL looks like:

CL-USER>

On the other hand, the Elisp REPL looks like (ran using M-x ielm):

*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP>

They are similar, so don't confuse the two.

When a function like this is successfully evaluated (C-x C-e) from
either a source-file (.lisp extension) or from the slime-scratch buffer
(C-x b *slime-scratch*, or use the slime selector)

(defun test (a b) (+ a b))

I get a confirmation in the minibuffer that looks like:
=>TEST

In the REPL, it looks like:

CL-USER>
;;;; (defun test (a b)   (+ a b)) ...
CL-USER>

This can now be tested direct from the REPL

CL-USER> (test 1 2)
3
CL-USER>


Note that unlike C-c C-c (compile), the point must be right after the
s-expression you are trying to evaluate with C-x C-e.

Have fun, I know I did.
From: Mario S. Mommer
Subject: Re: VERY elementary SLIME questions
Date: 
Message-ID: <87slomwkdo.fsf@moss-clad.net>
"sundar" <················@gmail.com> writes:
> Hi all, I'm new to Common LISP itself, to EMACS, to Ubuntu(on which I'm
> using EMACS), and to SLIME. I think you can imagine how much of a
> newbie I am. :-)
> I installed Emacs from the Ubuntu Hoary Hedgehog CD. Then I very
> recently added SLIME to it from slime-1.2.1.tar.gz.

That one is too old. It is unfortunate that this old tarball still is
on the slime web page. You should get slime from CVS.