[plt-scheme] Stylistic (I hope!) question regarding driver loop

From: Gregory Woodhouse (gregory.woodhouse at sbcglobal.net)
Date: Sat Jan 21 17:23:24 EST 2006

On Jan 21, 2006, at 2:06 PM, Gregory Woodhouse wrote:

>> Greg, try using syntax-check on this program in DrScheme:
>>
>> (define (f x) (letrec ([x x]) (f 1)))
>>   (f 1)
>>
>> (define (g x) (letrec ([x (g 1)]) x))
>>   (g 1)
>>
>> Then notice the purple arrow, when you
>> move the arrow over f.
>>
>> Then try the same with g.
>>
>> --  
>
> So...you're saying my code is bad because it invokes a function  
> bound by a letrec in the body of the letrec (like the x in g)?
>

I'm sorry, that's a dumb question (on my part). I thought that the  
point of the above is that x occurs after the recursive call to g,  
making it non-tail-recursive. Maybe I missed the point.

===
Gregory Woodhouse
gregory.woodhouse at sbcglobal.net

"A hero is no braver than an ordinary
man, but he is brave five minutes longer."
-- Ralph Waldo Emerson





Posted on the users mailing list.