Re: lisp function questions



Jon Harrop <usenet@xxxxxxxxxxxxxx> writes:

>
> Pascal Bourguignon wrote:
> >
> > (defun average (list) (and list (/ (reduce (function +) list) (length
> > list))))
>
> Could you elaborate on what you think is incorrect about my average
> function? It was a joke, but I believe it is correct.

I think it hinges on "correct". The general rule of thumb is that if
you find yourself using EVAL when writing a Lisp function then you are
doing something wrong. That goes double for new Lisp users.


--
Thomas A. Russ, USC/Information Sciences Institute

.