From: Bull Horse
Subject: Simple Lisp Question
Date: 
Message-ID: <327C9EAE.3E46@earthlink.net>
Why does lisp force all return to the screen??  Is it not designed to be 
a user based langauge?  How are programs written that require user input 
without sticking a ton of stuff on the screen to clutter it up.  Am I 
just totally wrong in the way I write code..


Take this:

(setq x (cons 'a (cons 'r (cons 'e nil))))


It is just the way lisp is that you have to deal with this sticking
 (a r e) on the screen  or is there a way around it?

From: Lyman S. Taylor
Subject: Re: Simple Lisp Question
Date: 
Message-ID: <55jpup$1an@pravda.cc.gatech.edu>
In article <·············@earthlink.net>,
Bull Horse  <···@earthlink.net> wrote:
>Why does lisp force all return to the screen?? 

  Because you are working/interacting with the lisp Listener. The Listener
  takes you lisp expressions, evaluates them, and shows you what the answer
  is. 

  If you wanted to write a "program" in the classical sense you would write
  a function called "main" or something like that. "Main" would call all
  of the functions that implement your "program". I/O could take place....
  and then when the user "quit" your "program" then the function "main"
  would exit. 

   "Welcome to lisp"
    ? (load "program.lisp")
    "loading  ..... program.lisp"
    ? (main )
	...	all sorts of program interacton or 
		....non interaction....
      T
    ?

The above returns T because at the end of the function "main" :

	(defun main () 
		..... 
		t)

If you are  hostile to outputing a T. then you can substitute the
expression  (values) .   Or you could replace it with the function
(bye)  or (quit)  or (exit)  whichever terminates your lisp environment.
Or if you don't care what the value returned is just let the last expression
evaluted return its value as the value of "main". 

To deliver a program to an unsuspecting user you would set things up
so that "main" was called on initialization ( you have to consult your
environment's documentation on how to do that) and when the user quit the 
"program" it would disappear( if the last expression was the termination
expression).  Or you can just go with the "load and go" as outlined above
if your user won't get "feaked out" over starting lisp and/or your
lisp environment doesn't support making an "application image". 


>Take this:
>
>(setq x (cons 'a (cons 'r (cons 'e nil))))
>
>
>It is just the way lisp is that you have to deal with this sticking
> (a r e) on the screen  or is there a way around it?

And if you are in the writing/debugging process????
If you just wrote a function, wouldn't you be interested in what value(s)
it will return? With the Listener you can test individual components of your 
program interactively.  

Or if you wonder what might happened if you executed some expression
in some function you are writing. Hmmm what would "this" do.  You can
"ask" the Listener if it will work instead of perusing some language
manual/source code listings tracing out the execution by hand ( or in 
your head ). 

Or in the learning Lisp process. You see some code in the book. Type it
in and it works. You make a change and re-evaluate to see what "that"
will do. 

Lisp code writing usually proceeds in an incremental fashion. Write some
portion of the system. Test it. Write some more.

It usually doesn't follow the  process of write tons of code.... and then 
"oh by the way" let's see of this acutally works. 

In C/Pascal/etc. you have to write some sort of "driver" code to invoke and
print the result of what your functions compute. Here you can test by
simply invoking it. If it is wrong. Fix the code and retest. Iterate until
all the functions in your program works. 

The Listener is "friendly" to the developer.....    and an end user need
never see it. 
-- 
					
Lyman S. Taylor            "It's not *OUR* fault....."
(·····@cc.gatech.edu)           Kei and Yuri , the 'Dirty Pair'... eerrr
					'Lovely Angels'
From: Barry Margolin
Subject: Re: Simple Lisp Question
Date: 
Message-ID: <55khe0$ak1@poblano.near.net>
In article <·············@earthlink.net>,
Bull Horse  <···@earthlink.net> wrote:
>Why does lisp force all return to the screen??  Is it not designed to be 
>a user based langauge?  How are programs written that require user input 
>without sticking a ton of stuff on the screen to clutter it up.  Am I 
>just totally wrong in the way I write code..

The read-eval-print loop is intended for interactive debugging of programs.

When an end-user is running a full program, they don't ordinarily type lots
of separate forms to the top-level loop.  They type one expression that
starts the program, and the program stays in control until it's completely
done.  In fact, they might not even type that first expression; most Lisp
implementations provide a way of creating an application that's started the
same way as other applications (typing a command at the Unix shell prompt,
or clicking on an icon in a GUI) which automatically executes an initial
expression when it starts up and exits from Lisp when it returns.
-- 
Barry Margolin
BBN Planet, Cambridge, MA
······@bbnplanet.com -  Phone (617) 873-3126 - Fax (617) 873-5508
(BBN customers, please call (800) 632-7638 option 1 for support)