<div>Yes, and it is quite easy. All you need to do is think about it and change the order of the cond a bit...</div>
<div>I'm not gonna tell you how, though, because I haven't slept in two days and I'm pretty much sure I'd get it wrong write now ;-).</div>
<div>Just a note: If you change the #t in that last cond case to else, it would look a bit better.</div>
<div>&nbsp;</div>
<div>The insomniac.<br>&nbsp;</div>
<div><span class="gmail_quote">On 10/9/05, <b class="gmail_sendername">George Herson</b> &lt;<a href="mailto:gherson@snet.net">gherson@snet.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I'm working thru The Little Lisper, 2nd Ed.&nbsp;&nbsp;Exercise<br>6.5 (p115) asks:&nbsp;&nbsp;Can one can change<br><br>(define member*
<br>(lambda (a l)<br>(cond<br>&nbsp;&nbsp; [(null? l) #f]<br>&nbsp;&nbsp; [(atom? (car l)) (or (eq? (car l) a)<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;(member* a (cdr l)))]<br>&nbsp;&nbsp; [#t (or (member* a (car l))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(member* a (cdr l)))])))<br><br>so that query
<br><br>(member*<br>&nbsp;&nbsp;'chips<br>&nbsp;&nbsp;'((potato) (chips ((with) fish) (chips))))<br><br>finds the last chips first?<br><br>Would that be a yes or would that be a no?<br><br>(This is not assigned homework.)<br><br>thx,<br>George Herson
<br>_________________________________________________<br>For list-related administrative tasks:<br><a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</blockquote></div><br>