Is this your homework assignment?<br><br>Robby<br><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 11:19 AM, Joe Burk <span dir="ltr"><<a href="mailto:joshwbfantasy@yahoo.com">joshwbfantasy@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">
Hey everyone, I'm a bit new to scheme and I'm looking for some help. Hopefully you guys can assist me. I was given these few questions and I have no clue where to start. So if anyone could answer them they would be of much help. Thanks.<br>
<br>Consider the following functions:<br><br>(define get-evens<br> (lambda (lst)<br> (cond ((null? lst) '())<br> ((even? (car lst)) (cons (car lst) (get-evens (cdr lst))))<br> (else (get-evens (cdr lst))))))<br>
<br>(define get-odds<br>
(lambda (lst)<br>
(cond ((null? lst) '())<br>
((odd? (car lst)) (cons (car lst) (get-odds (cdr lst))))<br>
(else (get-odds (cdr lst))))))<br><br>(define get>2<br> (lambda (lst)<br>
(cond ((null? lst) '())<br> ((> (car lst) 2) (cons (car lst) (get>2 (cdr lst))))<br> (else (get>2 (cdr lst))))))<br><br>1. Write another function that accepts a test as one of its arguments, and which can then behave like each of the above functions. Starting with:<br>
<br> (define extract<br> (lambda (test? lst)<br><br><br>2. Use extract to define get-evens, get-odds, and get>2<br><br></td></tr></tbody></table><br>
<br>_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
<br></blockquote></div><br>