[r6rs-discuss] A suggestion about LETREC

From: Abdulaziz Ghuloum <aghuloum>
Date: Wed Mar 28 17:51:55 2007

On Mar 28, 2007, at 5:27 PM, Thomas Lord wrote:

> Abdulaziz Ghuloum wrote:
>>> One advantage of this is that it would be much easier to create a
>>> purely
>>> functional subset of Scheme.
>>
>> How do you do the following functionally?
>>
>> (letrec ([f (g (lambda () f))])
>> f)
>
>
> Well, f is then given by
>
> (g (lambda () (g (lambda () (g (lambda () g ...))))))
>
> So what?

I don't know what the ellipsis mean. Just rewrite the following
expression as another Scheme expression that does not use letrec
or set!:

(lambda (g)
   (letrec ((f (g (lambda () f))))
      f))


Aziz,,,
Received on Wed Mar 28 2007 - 17:51:05 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC