Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Slime tips for beginners
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
philrand  
View profile  
 More options Dec 27 2010, 5:25 pm
From: philrand <philr...@gmail.com>
Date: Mon, 27 Dec 2010 14:25:16 -0800 (PST)
Local: Mon, Dec 27 2010 5:25 pm
Subject: Slime tips for beginners
Hi all,

I'm really enjoying Land of Lisp!

I can understand Conrad not wanting to complicate the book with all
the many details around source files, editing, editor configuration,
etc.  Paul Graham, as I recall, says he uses two terminal windows, one
with a REPL, the other with the vi editor.  For beginners, that's not
a bad way to go, maybe substituting your favorite editor for vi.  Be
sure to pick an editor that can help you with balancing parentheses.

I've always used emacs, and got somewhat used to slime during my last
fling with Common Lisp.  For what it's worth, here's how I set myself
up for Land of Lisp on my Mac:

1)  I've had macports installed forever, and used it to install CLISP.

1.5)  I sometimes use the terminal-only emacs that ships with Mac OS
X, but also like Aquamacs, which I think I installed via binary
download.

2)  I had previously used quicklisp (a new package manager for lisp
that aspires to be CPAM for common lisp -- see quicklisp.org) with
SBCL.  I couldn't quickly figure out how to easily switch between lisp
implementations in quicklisp, so I just wiped it out and installed it
all over again with CLISP.

3) I followed the directions in the quicklisp.org FAQ to install
slime.

4) I Made a working directory for my landoflisp stuff, and initialized
it as a git repo.

5) Created adv.lisp and started typing in the code for the wizard's
text adventure game.

Problem:  You can have slime tell clisp to compile the last symbolic
expression (complete lisp "form" with balanced parentheses) with the c-
x c-e (control-x control-e) keystroke.  I like to do that as I type in
the source, so I catch mistakes early.  The trouble was that when I
switched from the adv.lisp buffer to the "slime-repl clisp" buffer,
nothing I had complied was available.

Solution:  Conrad (wisely) doesn't seem to cover packages,  but I
suspect that the lisp package you are in when you type c-x c-e in a
file buffer doesn't match the default package in the slime repl
buffer.  I solved my problem by putting these lines at the top of
adv.lisp:

  (defpackage #:adventure
    (:use #:cl))

  (in-package #:adventure)

  (defparameter *nodes* ...

I then used c-x c-e on every s-expression again (there's a keystroke
for compiling the whole buffer, but I was too impatient to look it
up ;-)

Back in the slime repl, I typed (in-package #:adventure), and now
*nodes* and everything else was available.

Packages are lisp's version of modules or namespaces from other
languages, so the above first defined a package for the adventure
game, and then declared that the following code should go in the new
package.  Similarly, the in-package statement in the repl put me into
the adventure package namespace so the parameters, functions, and so
on would be available.

I'm basically an advanced beginner in common lisp, so better answers
from real lispers would be very welcome.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
philrand  
View profile  
 More options Dec 27 2010, 5:28 pm
From: philrand <philr...@gmail.com>
Date: Mon, 27 Dec 2010 14:28:52 -0800 (PST)
Local: Mon, Dec 27 2010 5:28 pm
Subject: Re: Slime tips for beginners

> 2)  I had previously used quicklisp (a new package manager for lisp
> that aspires to be CPAM for common lisp -- see quicklisp.org) with

Oops, that's CPAN, the Comprehensive Perl Archive Network.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Rand  
View profile  
 More options Dec 30 2010, 11:59 pm
From: Phil Rand <philr...@gmail.com>
Date: Thu, 30 Dec 2010 20:59:32 -0800 (PST)
Local: Thurs, Dec 30 2010 11:59 pm
Subject: Re: Slime tips for beginners

> Problem:  You can have slime tell clisp to compile the last symbolic
> expression (complete lisp "form" with balanced parentheses) with the c-
> x c-e (control-x control-e) keystroke.  I like to do that as I type in

Oops:  c-x c-e evaluates the last expression, but doesn't compile it.
Evaluation is what I needed in this context, though.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »