(define (let->combination exp)
(if (named-let? exp)
(let ((proc-name (let-named-var exp))
(proc-body (let-named-body exp))
(formal-params (let-named-formal-params exp))
(real-params (let-named-real-params exp)))
(sequence->exp
(list (list 'define proc-name
(make-lambda formal-params proc-body))
(list proc-name
real-params))))
(let ((formal-params (map car (let-vars exp)))
(real-params (map cdr (let-vars exp)))
(lambda-body (let-body exp)))
(list (make-lambda formal-params lambda-body)
real-params))
(define (let-named-var exp)
(cadr exp))
(define (let-named-formal-params exp)
(map car (caddr exp)))
(define (let-named-real-params exp)
(map cdr (caddr exp)))
(define (named-let? exp)
(and (let? exp)
(symbol? (cadr exp))))