Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lisp program easy to debug, maintain

2 views
Skip to first unread message

Jajwuth

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
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

Raymond Wiker

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
jaj...@aol.com (Jajwuth) writes:

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

Marco Antoniotti

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to

> jaj...@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

0 new messages