From: Jajwuth
Subject: lisp program easy to debug, maintain
Date: 
Message-ID: <20000123201538.02609.00001227@nso-fa.aol.com>
I've read where a lisp program is easy to debug (maintain too) and  writing and
planning the program is one in the same.
 I could see this if you apply the functions sequentially to the input data.
However if you have functions embedded within functions doesn't it get a little
complex.
How do you keep the programs  simple to achieve the above goals.
Al

From: Raymond Wiker
Subject: Re: lisp program easy to debug, maintain
Date: 
Message-ID: <871z77x3z3.fsf@foobar.orion.no>
·······@aol.com (Jajwuth) writes:

> I've read where a lisp program is easy to debug (maintain too) and
> writing and planning the program is one in the same.  I could see
> this if you apply the functions sequentially to the input data.
> However if you have functions embedded within functions doesn't it
> get a little complex.  How do you keep the programs simple to
> achieve the above goals.

        In the case of application-specific functions that calls other
application-level functions, you debug by writing the lower-level
functions and test them until you are satisfied that they are
correct. Then, you write higher-level functions that use the functions
that you have just debugged, and verify that you get the expected
results. Since you have already verified that the lower-level
functions work correctly, you can focus on the higher-level
functions. Continue this process until you get to the highest-level
function, and you'll have a complete program that has been more
thoroughly debugged and tested than you can expect to see for programs
written in a top-down style, or in a less interactive environment.

        By writing the code in this manner, you are building your
program in a bottom-up style. You are also effectively coding and
planning at the same time.

-- 
Raymond Wiker, Orion Systems AS
+47 370 61150
From: Marco Antoniotti
Subject: Re: lisp program easy to debug, maintain
Date: 
Message-ID: <lw3drnu9xz.fsf@parades.rm.cnr.it>
> ·······@aol.com (Jajwuth) writes:
> 
> > I've read where a lisp program is easy to debug (maintain too) and
> > writing and planning the program is one in the same.  I could see
> > this if you apply the functions sequentially to the input data.
> > However if you have functions embedded within functions doesn't it
> > get a little complex.  How do you keep the programs simple to
> > achieve the above goals.

Since when a three ISO-A4 pages long function/procedure containing
five different loops (some nested) is 'simpler' than a bunch of
separate functions doing exaclty what they advertise?

The rule of thumb should be: if it fits in a 50/60 lines Emacs frame
it's borderline :)  (I have been generous :) )  Anything longer is a
candidate for a rewrite.  Anything shorter may be as well :)

Cheers

-- 
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa