tags:

views:

59

answers:

1

I need some help in understanding the material in SICP's section 4.1.6 on Internal definitions.

I understand the problem raised when mutually recursive functions are defined. But i dont understand how it is solved by transforming the following lambda expression

(lambda <vars >
  (define u <e1 >)
  (define v <e2 >)
  <e3 >)

into:

(lambda <vars >
  (let ((u ’*unassigned*)
        (v ’*unassigned*))
    (set! u <e1 >)
    (set! v <e2 >)
    <e3 >))

Can someone help me out here? Thanks.

+2  A: 

If <e1> tries referring to v in the first form, it fails -- v is not defined (not yet, but the not part is the important one). But in the second form, v is defined by the time you get to <e1> (though not yet assigned -- but that's ok!-).

Alex Martelli