From: R. Giuly
Subject: Use of listeners and editors?
Date: 
Message-ID: <3ABC6F25.32F4232D@hotmail.com>
I've never seen a pro working on a lisp program so I have some simple
questions. I have seen books that suggest you just write code directly
into the listener. That's okay for a couple lines, but for a whole
program, you'd want the code you are working on in a file right? So if
you are working on a program that's moderate in size, you are telling
the listener to load the file you are working on over and over, not just
typing it into the listener. Is this how people usually program, making
files and loading those into the listener?

Sorry this is such a basic question, but I'm used to languages like java
and c where all you every do is edit files. I'm not sure how lisp
environments are intended to be used.

-- 
Richard Giuly

(remove animal from email address)

From: Kent M Pitman
Subject: Re: Use of listeners and editors?
Date: 
Message-ID: <sfw7l1f6yrx.fsf@world.std.com>
"R. Giuly" <·········@hotmail.com> writes:

> I've never seen a pro working on a lisp program so I have some simple
> questions. I have seen books that suggest you just write code directly
> into the listener. That's okay for a couple lines, but for a whole
> program, you'd want the code you are working on in a file right? So if
> you are working on a program that's moderate in size, you are telling
> the listener to load the file you are working on over and over, not just
> typing it into the listener. Is this how people usually program, making
> files and loading those into the listener?

Usually if they work in a listener they prototype an individual definition
there and then copy it into an editor  buffer when debugged.

The more common practice is to edit the definition into an editor buffer
and have a command that compiles it from there, or that secretly zaps it
into the listener without showing that it did (giving the same effect
as compiling in-place).  Usually if it's an emacs-like editor, getting help
on lisp mode will tell you the commands you want.

The other case that comes up sometimes is to have throwaway definitions
for testing that you define in a listener.  e.g., I might write
 (defun foo () (dotimes (i 100) (bar 3 4)))
in at the listener and then manually
 (compile'foo)
so I could do 
 (time (foo))
a lot.  I certainly don't care if that's in a file. If I need to edit it,
I'm usually using Xanalys LispWorks, which uses Emacs-like buffers for all
its interactions, even Listeners, so I just search back for "(defun foo"
to find the old definition, and copy it back down to the active area to edit 
for whatever changes I need.

> Sorry this is such a basic question, but I'm used to languages like java
> and c where all you every do is edit files. I'm not sure how lisp
> environments are intended to be used.

I think it's quite a good question.  Don't apologize.

It's made harder by the fact that the language definition tries hard to
be neutral about the possible set of interfaces you have, so it does (as
you seem to have intuited)  lean heavy on the use of listeners because
they can pretty much be relied on to always be there rather than emphasizing
some environment or another that is *probably* there but might not be.
Usually vendor-specific documentation is expected to take up this slack,
but for some vendors it might fall short.  Or you might not realize you're
supposed to be looking there.

I encourage you to ask other such questions here if you get stumped with
the documentation you have.  I, for one, appreciate knowing what kind of
obstacles new users see to making efficient use of Lisp systems, especially
as other languages increasingly create a sense of the "normal" which 
defies what Lisp tends to offer.  

I find it just as bizarre working in Java, btw.  Just in reverse.
I am really bugged about not having a Listener and incremental program
definition.  It seems to be for no really good reason.  That no Java
compiler I can find will compile a half-edited file, creating stub 
definitions for things it doesn't yet have definitions for rather than
erring, really bugs me.  It means you can't test a half-program, even if
you only plan to call the parts that are completed...   Waiting until I'm
all done with a program before testing it is really NOT something I like to
do.
From: Lieven Marchand
Subject: Re: Use of listeners and editors?
Date: 
Message-ID: <m34rwjjcsr.fsf@localhost.localdomain>
Kent M Pitman <······@world.std.com> writes:

> I find it just as bizarre working in Java, btw.  Just in reverse.
> I am really bugged about not having a Listener and incremental program
> definition.  It seems to be for no really good reason.  That no Java
> compiler I can find will compile a half-edited file, creating stub 
> definitions for things it doesn't yet have definitions for rather than
> erring, really bugs me.  It means you can't test a half-program, even if
> you only plan to call the parts that are completed...   Waiting until I'm
> all done with a program before testing it is really NOT something I like to
> do.

Most programming languages these days are still stuck in the Unix cc
mind set for no good reason at all. DEC SRC's Modula-3 compiler was a
nice exception to that. You could write the interface files for
interfaces you just designed, then write a client program and the
compiler would check the consistency of your stuff, which was a nice
way of testing interface design before getting to implementations.

-- 
Lieven Marchand <···@wyrd.be>
Gla�r ok reifr skyli gumna hverr, unz sinn b��r bana.
From: Bob Bane
Subject: Re: Use of listeners and editors?
Date: 
Message-ID: <3ABF934D.21542A2@removeme.gst.com>
Kent M Pitman wrote:
> 
> I find it just as bizarre working in Java, btw.  Just in reverse.
> I am really bugged about not having a Listener and incremental program
> definition.

Me too.  Lately I've been using Kawa (http://www.gnu.org/software/kawa)
as a bridge.  Kawa has a listener (of course), and some low-level
Scheme-Java mapping functions that let you pull basic Java operations up
into Scheme and play with them.  With Kawa I was able to go from zero
Java knowledge to cursing the design of the Thread class in a couple of
days.
-- 
Remove obvious stuff to e-mail me.
Bob Bane
From: Christian Nyb�
Subject: Re: Use of listeners and editors?
Date: 
Message-ID: <87r8zks4am.fsf@siteloft.com>
Kent M Pitman wrote:

> I find it just as bizarre working in Java, btw.  Just in reverse.
> I am really bugged about not having a Listener and incremental program
> definition.

Have you looked at beanshell?  
<URL:http://www.beanshell.org/intro.html>
-- 
chr
From: Lieven Marchand
Subject: Re: Use of listeners and editors?
Date: 
Message-ID: <m3ae6bnugd.fsf@localhost.localdomain>
"R. Giuly" <·········@hotmail.com> writes:

> I've never seen a pro working on a lisp program so I have some simple
> questions. I have seen books that suggest you just write code directly
> into the listener. That's okay for a couple lines, but for a whole
> program, you'd want the code you are working on in a file right? So if
> you are working on a program that's moderate in size, you are telling
> the listener to load the file you are working on over and over, not just
> typing it into the listener. Is this how people usually program, making
> files and loading those into the listener?

Most lisp environments have editor commands that allows you to
evaluate/compile forms, regions etc. In Emacs-like editors this is
usually C-M-x. People type their program in the editor, changing and
testing defuns until they are correct without continually reloading
files.

-- 
Lieven Marchand <···@wyrd.be>
Gla�r ok reifr skyli gumna hverr, unz sinn b��r bana.