<br><br><div class="gmail_quote">On Sat, May 16, 2009 at 4:22 PM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On May 16, Todd O'Bryan wrote:<br><br></div><div class="im">> And I'm supposed to rewrite letfuns so that it can handle mutually<br>
> recursive functions. More concretely, I write<br>
><br>
> (rewrite (letfuns ([(f x) E] ...) B)<br>
> => (my-code-here))<br>
><br>
> so that something like this<br>
><br>
> (letfuns<br>
> ([(even? n) (if (= n 0) #t (odd? (- n 1)))]<br>
> [(odd? n) (if (= n 0 #f (even? (- n 1))))])<br>
> (even? 123))<br>
><br>
> would produce the expected answer.<br>
><br>
<br>
</div>Well, since `f' (for example) is the list of function names, you could<br>
<div class="im">write<br>
<br>
(rewrite (letfuns ([(f x) E] ...) B)<br>
</div> => (list 'f ...))<br>
<br>
This will make a `letfuns' expression evaluate to a list of the<br>
function names as symbols.</blockquote><div><br>OK. I think I understand now. I need to combine (list 'f ...) (list x ...) and (list E ...) in the correct way, using map.<br><br>I'm having trouble keeping clear which level--syntactic or semantic--and which language--the underlying implementation language or the language I'm interpreting--I'm working in. Which is, I guess, the point. :-)<br>
<br>Todd <br><br> <br></div></div><br>