From: gavino
Subject: Learning lisp
Date: 
Message-ID: <1190679045.214266.119860@o80g2000hse.googlegroups.com>
I have Dave touretsky's book, and clisp installed with slime and
emacs.

I am reading through and learning a lot.

I had an old post here where Pascal helped me write a version of a
shell script and referred me to the common lisp spec.  I like the spec
but it is huge.  I am curious if anyone has written a little about how
to load / save your definitions that you build during a learning
session, such that you can reload them and continue the next day upon
firing up slime.  I found this simple with PLT scheme, but with the
emacs setup nothing seems to cover this small detail.  I want to learn
common lisp not scheme for my own preferences.

From: Ken Tilton
Subject: Re: Learning lisp
Date: 
Message-ID: <wyYJi.100$lj3.3@newsfe12.lga>
gavino wrote:
> I have Dave touretsky's book, and clisp installed with slime and
> emacs.
> 
> I am reading through and learning a lot.
> 
> I had an old post here where Pascal helped me write a version of a
> shell script and referred me to the common lisp spec.  I like the spec
> but it is huge.  I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.
> 

if you are brave put some code in your .emacs startup to automatically 
kick off an ASDF build of your code.

I am not brave, I start by emacsing a lisp file that has forms to kick 
off the asdf build.

The emacs wizards can tell you how to bind keychords to automate 
further, I 'spose.

You might also consider getting a free trial from LW or ACL (the latter 
on win32). Their IDEs are richer, and then you get native compilation, 
tho that is not a big issue straightaway.

kenny

-- 
http://www.theoryyalgebra.com/

"We are what we pretend to be." -Kurt Vonnegut
From: Leandro Rios
Subject: Re: Learning lisp
Date: 
Message-ID: <46f866ed$0$1342$834e42db@reader.greatnowhere.com>
gavino escribi�:
> I have Dave touretsky's book, and clisp installed with slime and
> emacs.
> 
> I am reading through and learning a lot.
> 
> I had an old post here where Pascal helped me write a version of a
> shell script and referred me to the common lisp spec.  I like the spec
> but it is huge.  I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.
> 

I started with Touretzky and emacs/Slime too. What I did at that time 
was to create a lisp file for each chapter of the book. Then it was only 
a matter of loading the file in emacs and hitting Ctrl-c Ctrl-k to have 
the file compiled and loaded. You'll find out the default keybindings in 
the slime manual (http://common-lisp.net/project/slime/doc/slime.pdf)

Leandro
From: D Herring
Subject: Re: Learning lisp
Date: 
Message-ID: <HtmdnaBa3drkEGXbnZ2dnUVZ_gGdnZ2d@comcast.com>
Leandro Rios wrote:
> gavino escribi�:
>> I have Dave touretsky's book, and clisp installed with slime and
>> emacs.
...
>> I am curious if anyone has written a little about how
>> to load / save your definitions that you build during a learning
>> session, such that you can reload them and continue the next day upon
>> firing up slime.  I found this simple with PLT scheme, but with the
>> emacs setup nothing seems to cover this small detail.  I want to learn
>> common lisp not scheme for my own preferences.
>>
> 
> I started with Touretzky and emacs/Slime too. What I did at that time 
> was to create a lisp file for each chapter of the book. Then it was only 
> a matter of loading the file in emacs and hitting Ctrl-c Ctrl-k to have 
> the file compiled and loaded. You'll find out the default keybindings in 
> the slime manual (http://common-lisp.net/project/slime/doc/slime.pdf)

If you prefer exploring directly in the REPL, dribble can help.
http://lispdoc.com/?q=dribble

To enable tab completion in a .lisp buffer, add
(define-key slime-mode-map (kbd "TAB")
             'slime-indent-and-complete-symbol)
to the .emacs startup file.

- Daniel
From: Leandro Rios
Subject: Re: Learning lisp
Date: 
Message-ID: <46f96172$0$1340$834e42db@reader.greatnowhere.com>
D Herring escribi�:
> If you prefer exploring directly in the REPL, dribble can help.
> http://lispdoc.com/?q=dribble
> 

Thanks, I didn't know about dribble. I just saved the *slime-repl* buffer.

Leandro
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190751444.918088.142260@r29g2000hsg.googlegroups.com>
On Sep 25, 12:28 pm, Leandro Rios <··················@gmail.com>
wrote:
> D Herring escribi�:
>
> > If you prefer exploring directly in the REPL, dribble can help.
> >http://lispdoc.com/?q=dribble
>
> Thanks, I didn't know about dribble. I just saved the *slime-repl* buffer.
>
> Leandro

I have the slime_emacs setup on my home linux box.  This is on a test
box at work.  Does anyone know the answer to my question or what part
of the man page to look it up?
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190755182.063133.147770@r29g2000hsg.googlegroups.com>
On Sep 25, 1:17 pm, gavino <·········@gmail.com> wrote:
> On Sep 25, 12:28 pm, Leandro Rios <··················@gmail.com>
> wrote:
>
> > D Herring escribi�:
>
> > > If you prefer exploring directly in the REPL, dribble can help.
> > >http://lispdoc.com/?q=dribble
>
> > Thanks, I didn't know about dribble. I just saved the *slime-repl* buffer.
>
> > Leandro
>
> I have the slime_emacs setup on my home linux box.  This is on a test
> box at work.  Does anyone know the answer to my question or what part
> of the man page to look it up?

I am serious, where is the simple command to save the current session
to a file?
From: Alan Crowe
Subject: Re: Learning lisp
Date: 
Message-ID: <861wcmpef4.fsf@cawtech.freeserve.co.uk>
gavino <·········@gmail.com> writes:

> > I have the slime_emacs setup on my home linux box.  This is on a test
> > box at work.  Does anyone know the answer to my question or what part
> > of the man page to look it up?
> 
> I am serious, where is the simple command to save the current session
> to a file?

I think I know the command you mean, the one to save a
core file. I never use it. 

Err, I used it two hours ago, because I downloaded ACL2 and
built it. The build script saves a core file. But that is
different.

If you play about, save a core, load it, play about some
more, you pretty soon end up with an image that you cannot
recreate because it depends on some files that you have
edited since you loaded them.

Alan Crowe
Edinburgh
Scotland   
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190761151.797781.320030@22g2000hsm.googlegroups.com>
On Sep 25, 3:29 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
> gavino <·········@gmail.com> writes:
> > > I have the slime_emacs setup on my home linux box.  This is on a test
> > > box at work.  Does anyone know the answer to my question or what part
> > > of the man page to look it up?
>
> > I am serious, where is the simple command to save the current session
> > to a file?
>
> I think I know the command you mean, the one to save a
> core file. I never use it.
>
> Err, I used it two hours ago, because I downloaded ACL2 and
> built it. The build script saves a core file. But that is
> different.
>
> If you play about, save a core, load it, play about some
> more, you pretty soon end up with an image that you cannot
> recreate because it depends on some files that you have
> edited since you loaded them.
>
> Alan Crowe
> Edinburgh
> Scotland

hm

Okay I am honestly getting frustrated.  I am trying n the clisp page
and in the spec to find how I save my session.  I can not find out
how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
work.  I just want to save the function definitions I have created so
far.
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190761833.341789.175560@k79g2000hse.googlegroups.com>
On Sep 25, 3:59 pm, gavino <·········@gmail.com> wrote:
> On Sep 25, 3:29 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
>
>
>
> > gavino <·········@gmail.com> writes:
> > > > I have the slime_emacs setup on my home linux box.  This is on a test
> > > > box at work.  Does anyone know the answer to my question or what part
> > > > of the man page to look it up?
>
> > > I am serious, where is the simple command to save the current session
> > > to a file?
>
> > I think I know the command you mean, the one to save a
> > core file. I never use it.
>
> > Err, I used it two hours ago, because I downloaded ACL2 and
> > built it. The build script saves a core file. But that is
> > different.
>
> > If you play about, save a core, load it, play about some
> > more, you pretty soon end up with an image that you cannot
> > recreate because it depends on some files that you have
> > edited since you loaded them.
>
> > Alan Crowe
> > Edinburgh
> > Scotland
>
> hm
>
> Okay I am honestly getting frustrated.  I am trying n the clisp page
> and in the spec to find how I save my session.  I can not find out
> how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
> work.  I just want to save the function definitions I have created so
> far.

ok, it appears that loading definitions can be done from a file.  the
clisp -i option seems to accomplish this.
http://www.lisp.org/HyperSpec/Body/sec_24-1-1.html
So I have to open vi and type in all of my definitions.  Then start
clisp with that file...
Hm
Is there a way to have clisp dump everthing that I have defined in a
running REPL to a file?
While I am at it I will give clisp 100MB of memory to use..
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190762253.772732.232150@o80g2000hse.googlegroups.com>
On Sep 25, 3:59 pm, gavino <·········@gmail.com> wrote:
> On Sep 25, 3:29 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
>
>
>
> > gavino <·········@gmail.com> writes:
> > > > I have the slime_emacs setup on my home linux box.  This is on a test
> > > > box at work.  Does anyone know the answer to my question or what part
> > > > of the man page to look it up?
>
> > > I am serious, where is the simple command to save the current session
> > > to a file?
>
> > I think I know the command you mean, the one to save a
> > core file. I never use it.
>
> > Err, I used it two hours ago, because I downloaded ACL2 and
> > built it. The build script saves a core file. But that is
> > different.
>
> > If you play about, save a core, load it, play about some
> > more, you pretty soon end up with an image that you cannot
> > recreate because it depends on some files that you have
> > edited since you loaded them.
>
> > Alan Crowe
> > Edinburgh
> > Scotland
>
> hm
>
> Okay I am honestly getting frustrated.  I am trying n the clisp page
> and in the spec to find how I save my session.  I can not find out
> how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
> work.  I just want to save the function definitions I have created so
> far.

it worked!!!! my confidence is soaring, screw others who tell me to
just learn perl, fuck that, I can do this.
If there is a way to tell the current clisp to dump all definitions to
a file please someone post!!
[·····@ops2 lisp]$ cat stuff
(defun taxes (wage hours tax)
        (* wage hours tax))
[·····@ops2 lisp]$ clisp -i stuff -m 100MB
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006

;; Loading file stuff ...
;; Loaded file stuff
[1]> (taxes 75 40 0.35)
1050.0
[2]>
From: D Herring
Subject: Re: Learning lisp
Date: 
Message-ID: <bsadnaXH6PqEI2TbnZ2dnUVZ_rGrnZ2d@comcast.com>
gavino wrote:
> On Sep 25, 3:59 pm, gavino <·········@gmail.com> wrote:
>> Okay I am honestly getting frustrated.  I am trying n the clisp page
>> and in the spec to find how I save my session.  I can not find out
>> how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
>> work.  I just want to save the function definitions I have created so
>> far.
> 
> it worked!!!! my confidence is soaring, screw others who tell me to
> just learn perl, fuck that, I can do this.
> If there is a way to tell the current clisp to dump all definitions to
> a file please someone post!!

Where did you here that Clisp had such a feature?  The spec doesn't 
require Lisp to remember everything you type at the prompt -- that 
would place unreasonable demands on memory.  The spec does allow you 
to tell Lisp to store commands to a file (dribble "file").  Many Lisps 
also allow you to save a "core" file; this is usually a binary image 
that can be started instead of the normal lisp command.  Again, it 
probably doesn't contain the raw text of your function definitions. 
Sometimes (describe 'function) is good enough.

Example:
 > sbcl
This is SBCL 1.0.8.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (dribble "test.txt")

* (defun f (x) (+ x 3))

F
* (describe 'f)

F is an internal symbol in #<PACKAGE "COMMON-LISP-USER">.
Function: #<FUNCTION F>
Its associated name (as in FUNCTION-LAMBDA-EXPRESSION) is F.
The function's arguments are:  (X)
Its defined argument types are:
   (T)
Its result type is:
   (VALUES NUMBER &OPTIONAL)
On Tue, Sep 25, 2007 10:05:21 PM EDT it was compiled from:
   (LAMBDA () (PROGN (SB-INT:NAMED-LAMBDA F (X) (BLOCK F (+ X 3)))))

* (quit)
 > cat test.txt

* (defun f (x) (+ x 3))

F
* (describe 'f)

F is an internal symbol in #<PACKAGE "COMMON-LISP-USER">.
Function: #<FUNCTION F>
Its associated name (as in FUNCTION-LAMBDA-EXPRESSION) is F.
The function's arguments are:  (X)
Its defined argument types are:
   (T)
Its result type is:
   (VALUES NUMBER &OPTIONAL)
On Tue, Sep 25, 2007 10:05:21 PM EDT it was compiled from:
   (LAMBDA () (PROGN (SB-INT:NAMED-LAMBDA F (X) (BLOCK F (+ X 3)))))

* (quit)
 >


- Daniel
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190862234.661865.249510@d55g2000hsg.googlegroups.com>
On Sep 25, 7:08 pm, D Herring <········@at.tentpost.dot.com> wrote:
> gavino wrote:
> > On Sep 25, 3:59 pm, gavino <·········@gmail.com> wrote:
> >> Okay I am honestly getting frustrated.  I am trying n the clisp page
> >> and in the spec to find how I save my session.  I can not find out
> >> how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
> >> work.  I just want to save the function definitions I have created so
> >> far.
>
> > it worked!!!! my confidence is soaring, screw others who tell me to
> > just learn perl, fuck that, I can do this.
> > If there is a way to tell the current clisp to dump all definitions to
> > a file please someone post!!
>
> Where did you here that Clisp had such a feature?  The spec doesn't
> require Lisp to remember everything you type at the prompt -- that
> would place unreasonable demands on memory.  The spec does allow you
> to tell Lisp to store commands to a file (dribble "file").  Many Lisps
> also allow you to save a "core" file; this is usually a binary image
> that can be started instead of the normal lisp command.  Again, it
> probably doesn't contain the raw text of your function definitions.
> Sometimes (describe 'function) is good enough.
>
> Example:
>  > sbcl
> This is SBCL 1.0.8.9, an implementation of ANSI Common Lisp.
> More information about SBCL is available at <http://www.sbcl.org/>.
>
> SBCL is free software, provided as is, with absolutely no warranty.
> It is mostly in the public domain; some portions are provided under
> BSD-style licenses.  See the CREDITS and COPYING files in the
> distribution for more information.
> * (dribble "test.txt")
>
> * (defun f (x) (+ x 3))
>
> F
> * (describe 'f)
>
> F is an internal symbol in #<PACKAGE "COMMON-LISP-USER">.
> Function: #<FUNCTION F>
> Its associated name (as in FUNCTION-LAMBDA-EXPRESSION) is F.
> The function's arguments are:  (X)
> Its defined argument types are:
>    (T)
> Its result type is:
>    (VALUES NUMBER &OPTIONAL)
> On Tue, Sep 25, 2007 10:05:21 PM EDT it was compiled from:
>    (LAMBDA () (PROGN (SB-INT:NAMED-LAMBDA F (X) (BLOCK F (+ X 3)))))
>
> * (quit)
>  > cat test.txt
>
> * (defun f (x) (+ x 3))
>
> F
> * (describe 'f)
>
> F is an internal symbol in #<PACKAGE "COMMON-LISP-USER">.
> Function: #<FUNCTION F>
> Its associated name (as in FUNCTION-LAMBDA-EXPRESSION) is F.
> The function's arguments are:  (X)
> Its defined argument types are:
>    (T)
> Its result type is:
>    (VALUES NUMBER &OPTIONAL)
> On Tue, Sep 25, 2007 10:05:21 PM EDT it was compiled from:
>    (LAMBDA () (PROGN (SB-INT:NAMED-LAMBDA F (X) (BLOCK F (+ X 3)))))
>
> * (quit)
>  >
>
> - Daniel

Thank you.  I think perhaps I was worrying too much.  How do common
lispers save their Programs for alter use?
From: ···············@gmail.com
Subject: Re: Learning lisp
Date: 
Message-ID: <1190890413.718184.180960@o80g2000hse.googlegroups.com>
On 27 Sep, 04:03, gavino <·········@gmail.com> wrote:

> Thank you.  I think perhaps I was worrying too much.  How do common
> lispers save their Programs for alter use?

There have been various posts in the past about the best flow to
programming in Lisp. I suspect most of us use some variant of the same
basic idea, slightly tailored to our personal preferences and
selection of tools (Lisp system, REPL features, editing environment,
etc). I'll describe roughly what I do but this is just my opinion and
not in any way the only or even the recommended approach. Others may
offer something even more general or useful or correct my bad habits.

On the whole, you will write code (functions, classes, macros, etc) in
an editor. You can submit these definitions to the running Lisp system
and they will be added to it. This is the image bit that seems to be
causing some confusion. When you're happy with your definitions, you
can save the code file to disc as you would with most other languages.
You can re-load these into a fresh Lisp image tomorrow and continue
working on your program. Note that you can (load ...) whole files or
submit individual definitions. Your editor should help you with this.

You can save the image to disc but really this is more something you
would want to do once you're happy with your program and you want to
actually use it or distribute it to others. It's not generally
something you need to worry about while you're programming and
debugging your code. In fact it can cause you problems to rely on the
state of the image if you're not extremely careful as you may leave
something defined in there but then change (or remove) the definition
from your code file(s). This may be innocuous for the current session
but can cause problems in the future if, for example, a function that
is no longer in your code file is actually required by something in
the image you're working with.

Of course, there is the more obvious problem of portability. The
source code is still your raw material as it is with other languages
so you need to have this unless you write perfect code first time
every time. Most of us don't quite manage this.

Try to disentangle the two things in your head and see what each is
for. They are certainly related but I don't think quite in the way
that you expect.

--
Phil
http://phil.nullable.eu/
From: Thomas A. Russ
Subject: Re: Learning lisp
Date: 
Message-ID: <ymips043s75.fsf@blackcat.isi.edu>
gavino <·········@gmail.com> writes:

> Thank you.  I think perhaps I was worrying too much.  How do common
> lispers save their Programs for alter use?

We develop the programs in files instead of in the REPL.

Our development environment takes care of communicating with the lisp
program to evaluate, compile or run the code that we are developing.

Since the code is in standard files that are being edited, it is trivial
to save them for later use.


-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Rainer Joswig
Subject: Re: Learning lisp
Date: 
Message-ID: <joswig-24085A.01094626092007@news-europe.giganews.com>
In article <························@22g2000hsm.googlegroups.com>,
 gavino <·········@gmail.com> wrote:

> On Sep 25, 3:29 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
> > gavino <·········@gmail.com> writes:
> > > > I have the slime_emacs setup on my home linux box.  This is on a test
> > > > box at work.  Does anyone know the answer to my question or what part
> > > > of the man page to look it up?
> >
> > > I am serious, where is the simple command to save the current session
> > > to a file?
> >
> > I think I know the command you mean, the one to save a
> > core file. I never use it.
> >
> > Err, I used it two hours ago, because I downloaded ACL2 and
> > built it. The build script saves a core file. But that is
> > different.
> >
> > If you play about, save a core, load it, play about some
> > more, you pretty soon end up with an image that you cannot
> > recreate because it depends on some files that you have
> > edited since you loaded them.
> >
> > Alan Crowe
> > Edinburgh
> > Scotland
> 
> hm
> 
> Okay I am honestly getting frustrated.  I am trying n the clisp page
> and in the spec to find how I save my session.  I can not find out
> how.  I have clisp 2.41 on redhat linux with 2.6.9 kernel here at
> work.  I just want to save the function definitions I have created so
> far.


http://clisp.cons.org/impnotes.html#image

See also DRIBBLE:

http://clisp.cons.org/impnotes.html#dribble
http://www.lisp.org/HyperSpec/Body/fun_dribble.html
From: ···············@gmail.com
Subject: Re: Learning lisp
Date: 
Message-ID: <1190699013.586042.127930@22g2000hsm.googlegroups.com>
On Sep 25, 1:10 am, gavino <·········@gmail.com> wrote:

> I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.

I wrote ABLE (http://phil.nullable.eu/) as I wanted to learn Common
Lisp but wanted something a little like PLT's DrScheme so it may also
work for you. Although what you want to do should also be very easy
with SLIME so maybe I don't understand your question.

--
Phil
http://phil.nullable.eu/
From: Slobodan Blazeski
Subject: Re: Learning lisp
Date: 
Message-ID: <1190705314.909642.174380@k79g2000hse.googlegroups.com>
On Sep 25, 2:10 am, gavino <·········@gmail.com> wrote:
> I have Dave touretsky's book, and clisp installed with slime and
> emacs.
>
> I am reading through and learning a lot.
>
> I had an old post here where Pascal helped me write a version of a
> shell script and referred me to the common lisp spec.  I like the spec
> but it is huge.  I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.

How about posting some code you actually wrote yourself so rest all us
we'll know that this is not one of your "Does lisp has anything like
&*^&*(···@#^$?" threads?
From: gavino
Subject: Re: Learning lisp
Date: 
Message-ID: <1190738136.139243.59790@o80g2000hse.googlegroups.com>
On Sep 25, 12:28 am, Slobodan Blazeski <·················@gmail.com>
wrote:
> On Sep 25, 2:10 am, gavino <·········@gmail.com> wrote:
>
> > I have Dave touretsky's book, and clisp installed with slime and
> > emacs.
>
> > I am reading through and learning a lot.
>
> > I had an old post here where Pascal helped me write a version of a
> > shell script and referred me to the common lisp spec.  I like the spec
> > but it is huge.  I am curious if anyone has written a little about how
> > to load / save your definitions that you build during a learning
> > session, such that you can reload them and continue the next day upon
> > firing up slime.  I found this simple with PLT scheme, but with the
> > emacs setup nothing seems to cover this small detail.  I want to learn
> > common lisp not scheme for my own preferences.
>
> How about posting some code you actually wrote yourself so rest all us
> we'll know that this is not one of your "Does lisp has anything like
> &*^&*(···@#^$?" threads?

Ok here is something small I wrote.  I am looking up how to save this
stuff such that I can reload it next time.
[·····@ops2 ~]$ cd learn/lisp/
[·····@ops2 lisp]$ clisp
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006


[1]> (defun taxes (wage hours rate))
TAXES
[2]> (taxes 4 3 4)
NIL
[3]> (defun taxes (wages hours tax)
(* wages hours tax))
TAXES
[4]> (taxes 75 40 0.35)
1050.0
[5]> (defun takehome (wages hours tax)
(- (* wages hours) (taxes wages hours tax)))
TAKEHOME
[6]> (takehome 75 40 0.35)
1950.0
From: Leandro Rios
Subject: Re: Learning lisp
Date: 
Message-ID: <46f96059$0$1346$834e42db@reader.greatnowhere.com>
gavino escribi�:
> 
> Ok here is something small I wrote.  I am looking up how to save this
> stuff such that I can reload it next time.
> [·····@ops2 ~]$ cd learn/lisp/
> [·····@ops2 lisp]$ clisp
>   i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
>   I I I I I I I      8     8   8           8     8     o  8    8
>   I  \ `+' /  I      8         8           8     8        8    8
>    \  `-+-'  /       8         8           8      ooooo   8oooo
>     `-__|__-'        8         8           8           8  8
>         |            8     o   8           8     o     8  8
>   ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
> 
> 

But this is not clisp+emacs+slime. This is just clisp.
I am wondering if Slobodan is right... What page of Touretzky's are you on?

Leandro
From: Slobodan Blazeski
Subject: Re: Learning lisp
Date: 
Message-ID: <1190893503.677164.287580@57g2000hsv.googlegroups.com>
On Sep 25, 6:35 pm, gavino <·········@gmail.com> wrote:
> On Sep 25, 12:28 am, Slobodan Blazeski <·················@gmail.com>
> wrote:
>
>
>
> > On Sep 25, 2:10 am, gavino <·········@gmail.com> wrote:
>
> > > I have Dave touretsky's book, and clisp installed with slime and
> > > emacs.
>
> > > I am reading through and learning a lot.
>
> > > I had an old post here where Pascal helped me write a version of a
> > > shell script and referred me to the common lisp spec.  I like the spec
> > > but it is huge.  I am curious if anyone has written a little about how
> > > to load / save your definitions that you build during a learning
> > > session, such that you can reload them and continue the next day upon
> > > firing up slime.  I found this simple with PLT scheme, but with the
> > > emacs setup nothing seems to cover this small detail.  I want to learn
> > > common lisp not scheme for my own preferences.
>
> > How about posting some code you actually wrote yourself so rest all us
> > we'll know that this is not one of your "Does lisp has anything like
> > &*^&*(···@#^$?" threads?
>
> Ok here is something small I wrote.  I am looking up how to save this
> stuff such that I can reload it next time.
> [·····@ops2 ~]$ cd learn/lisp/
> [·····@ops2 lisp]$ clisp
>   i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
>   I I I I I I I      8     8   8           8     8     o  8    8
>   I  \ `+' /  I      8         8           8     8        8    8
>    \  `-+-'  /       8         8           8      ooooo   8oooo
>     `-__|__-'        8         8           8           8  8
>         |            8     o   8           8     o     8  8
>   ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
>
> Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
> Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
> Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
> Copyright (c) Bruno Haible, Sam Steingold 1999-2000
> Copyright (c) Sam Steingold, Bruno Haible 2001-2006
>
> [1]> (defun taxes (wage hours rate))
> TAXES
> [2]> (taxes 4 3 4)
> NIL
> [3]> (defun taxes (wages hours tax)
> (* wages hours tax))
> TAXES
> [4]> (taxes 75 40 0.35)
> 1050.0
> [5]> (defun takehome (wages hours tax)
> (- (* wages hours) (taxes wages hours tax)))
> TAKEHOME
> [6]> (takehome 75 40 0.35)
> 1950.0

Not much but it's a start. I don't use clisp so I'm unable to help
you.
Usually when I start some project I make simple .asd so I could reload
project
easily.

cheers
bobi
From: Alan Crowe
Subject: Re: Learning lisp
Date: 
Message-ID: <864phiprds.fsf@cawtech.freeserve.co.uk>
gavino <·········@gmail.com> writes:

> I have Dave touretsky's book, and clisp installed with slime and
> emacs.
> 
> I am reading through and learning a lot.
> 
> I had an old post here where Pascal helped me write a version of a
> shell script and referred me to the common lisp spec.  I like the spec
> but it is huge.  I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.

I wrote a webpage

http://www.cawtech.demon.co.uk/lisp/before-you-start.html

initially very brief, because the sooner you write your own
code the better.

Reading your post, perhaps my page is too brief.

I suggest splitting the screen in two, vertically, with
CTRL-x 3.

The REPL is on the left side. A file, opened with Ctrl-x Ctrl-f
is on the right.

Suppose you want to learn. You need to go on little
adventures, writing small programs and trying them out. For
example you might try writing a program to compute square
roots using Newton's Method.

Here is the moment to think ahead. It is important not to
frustrate yourself by biting off more than you can chew. It
is natural to have a plan: first I write a function that
computes square roots, second I hack my code about to make
it compute cube roots, third ... but wait. Square roots
might be enough for one day, so we need to keep the code to
work on some more tomorrow.

Ah, the code to compute square roots goes on the right, in
the file. Ctrl-Meta-x sends the definition to the REPL.
Switch to the left hand window and try it.

(my-square-root 3)

(my-square-root 4)

(dolist (x '(1 2 3 4))
  (format t "~&~The square root of ~A is ~A."
            x (my-square-root x)))

(loop repeat 10
      for x = (random 10.0)
      do (let ((root-x (my-square-root x)))
           (format t "~&root of ~A is ~A with error ~A."
                   x root-x (- x (expt root-x 2)))))

Ephemeral code to try out your work is typed directly to the
REPL. The code you plan to work on some more, tomorrow, is
typed into the file, and sent across with Ctrl-Meta-x.

Remember to save it (Ctrl-x Ctrl-s)

Tomorrow you can type (load "newtons-method.lisp") and all
the definitions in your file will be loaded into your
image. You can pick up where you left off, without having to
send each definition to the REPL individually.

You don't have to bork you existing code. Just cut and paste
in emacs to create a second copy of 
(defun my-square-root(x) ...)

Hack on that, changing square to cube etc.

Hmm, maybe I'm going into too much detail here and over
instructing. There is a meta-message lurking behind what
I've written. The fun comes from writing your own code. But
that can get pretty intense. Sometimes it just will not work
and one cannot work out why, which can be upsetting. It is a
bit like playing chess. Some games you lose. So maybe you
need encouragement and hand holding from c.l.l.

comp.lang.lisp is where we hang out to chill and kick back
(I hope I am using American vernacular correctly). If you
read comp.lang.lisp you get the wrong impression. The actual
fun is had privately at the REPL. comp.lang.lisp is just
windbagging.

So my real purpose is to encourage you to write your own
code. Otherwise you will miss out on the fun.

Alan Crowe
Edinburgh
Scotland
From: James
Subject: Re: Learning lisp
Date: 
Message-ID: <1190941396.944574.133130@19g2000hsx.googlegroups.com>
snip
>
> Alan Crowe
> Edinburgh
> Scotland

Alan -

Just wanted to say that your tips were greatly appreciated - this type
of stuff is great - tips -n- tricks, how someone else works the
system.  Thanks for the efforts, keep it up!

JP
From: Ken Tilton
Subject: Re: Learning lisp
Date: 
Message-ID: <P6_Ki.23$j56.8@newsfe12.lga>
James wrote:
> snip
> 
>>Alan Crowe
>>Edinburgh
>>Scotland
> 
> 
> Alan -
> 
> Just wanted to say that your tips were greatly appreciated - this type
> of stuff is great - tips -n- tricks, how someone else works the
> system.

I use my cell phone for editing. Those ten keys are about all I can keep 
in memory (PG explained all this in re Arc), and if I have a question 
while coding, damn, I just hit "send"!

>  Thanks for the efforts, keep it up!

Well, I hope you are pleased with yourself, Mr. Crowe. Clearly here was 
a solid chance to rid us of a noob, a noob on the brink, needing just a 
gentle nudge, nay, no more than benign neglect to be rid of him forever, 
but noooooooooo, it's Mr. Crowe to the rescue, isn't it? Damn you, you 
bleeding heart, nooby-hugging lisperals!

All I can say is, thank God there are languages like F# where I can 
hide, languages with no risk of succeeding, ones that have seized that 
evanescent niche intersection of cool developers who dig Microsoft .NET.

kenny

-- 
http://www.theoryyalgebra.com/

"We are what we pretend to be." -Kurt Vonnegut
From: Tim X
Subject: Re: Learning lisp
Date: 
Message-ID: <878x6r9f5j.fsf@lion.rapttech.com.au>
gavino <·········@gmail.com> writes:

> I have Dave touretsky's book, and clisp installed with slime and
> emacs.
>
> I am reading through and learning a lot.
>
> I had an old post here where Pascal helped me write a version of a
> shell script and referred me to the common lisp spec.  I like the spec
> but it is huge.  I am curious if anyone has written a little about how
> to load / save your definitions that you build during a learning
> session, such that you can reload them and continue the next day upon
> firing up slime.  I found this simple with PLT scheme, but with the
> emacs setup nothing seems to cover this small detail.  I want to learn
> common lisp not scheme for my own preferences.
>

One very simple way is to put the stuff you are doing in a file that you
have put into lisp mode. You can then use various commands, such as eval
sexp, region etc to send that to the slime process. then, when you are
finished for the day, you can save the file. Next time, start slime, open
the file and continue from where you left off. If you are defining
functions, macros etc, you can evaluate the file to get to the point you
were at when you finished previously. After you have learned a bit, you can
look at creating packages and asdf, which can automate things a lot
better. 

The point is that once you have slime running, you don't have to enter
everything at the REPL. If you open a file and do a M-x slime-mode, the
file will be put into a mode that makes it easy to send bits of code to the
slime REPL. As it is just a file, you can save it and open it agian next
time. Note that this is just to get started, there are better ways, but you
can learn about them later.

Tim

-- 
tcross (at) rapttech dot com dot au