"THaawk" <········@hotmail.com> writes:
> I am trying to defun something to work like:
>
> (biggest '(2 7 44 3 87))
>
> which returns 87.
>
> I *MUST NOT* use the min function.
Then use MAX. :)
>
> Thanks for your help
>
Try this:
(defun get-max (x y) (if (< x y) y x))
(defun biggest (l) (reduce #'get-max l))
The program is not completely correct, although it works in your test
case. Why is not correct? Extra credit if you find out why.
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