(define (bla1 x y)
(define bla-var1 (+ 15 x y))
(define bla-var2 (+ 19 x y))
(+ bla-var1 bla-var2))
> (bla1 10 20)
94
> (define (bla1 x y)
(let ((bla-var1 (+ 15 x y))
(bla-var2 (+ 19 x y)))
(+ bla-var1 bla-var2)))
> (bla1 10 20)
is this syntactic sugar?
94
>
To a first approximation, the answer to the final question is "yes" ...
if you substitute "letrec" for "let", in the general case. That
is, you can use internal defines to create local procedures which can
call each other recursively. That can also be done with "letrec", but
not with plain "let".
--
---------------------------------------------------------------------
Tom Edelson Poltergeists are the
http://www.well.com/user/edelsont/ principal type
"tom0613" at "mindspring.com" of material manifestation.
---------------------------------------------------------------------
(import (rnrs))
(letrec
((fun (lambda (n)
(if (= n 0)
(begin (display "Done"))
(begin (display n) (newline)
(fun (- n 1)))))))
(fun 10))
Try changing it to a 'let' and 'fun' won't be in scope of the value-
body (which in this chase is the lambda function).