From: THaawk
Subject: beginner help - sorting numbers RECURSIVELY
Date: 
Message-ID: <8838m9$1s8$1@news7.svr.pol.co.uk>
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.

Thanks for your help
From: Marco Antoniotti
Subject: Re: beginner help - sorting numbers RECURSIVELY
Date: 
Message-ID: <lwn1p6lg6i.fsf@parades.rm.cnr.it>
"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