<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I know how to write a simple collector<br><br>(define collect-range<br>&nbsp; (lambda (min max)<br>&nbsp;&nbsp;&nbsp; (cons (min (cons max ' ())))))<br><br>But that will just return a list containing its two arguments.&nbsp; I want my function to be able produce results such as these.<br><br>(get range ' (3 7 5 1 2 4) collect-range)&nbsp; and it will return ' (1 7)<br><br>Ok so first off i have to define collect max. Which I do as follows<br><br>&nbsp;(define collect-max<br>&nbsp;&nbsp; (lambda (max)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; max))<br><br>Next I have to define get max. Which is simply<br><br>(define get-max<br>&nbsp; (lambda (lst collector)<br>&nbsp;&nbsp;&nbsp; (cond ((null? lst) (collector 0))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 (else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (get-max (cdr lst)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lambda (max)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cond ((&gt; (car lst) max)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (collector (car lst)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (collector max)))))))))<br><br>So the get max function will
 be able to keep track of the highest number in the list. <br><br>I need a function that can keep track of both the highest AND the number lowest in the list. If anyone could help me out I'd greatly appreciate it. Thanks!<br></td></tr></table><br>