Martin Schneeweis
2018-07-16 13:51:09 UTC
Hi,
is it expected behaviour that (a) does not work but (b) does?
a) define after begin
(define rec-1 (lambda (depth)
(if (fx< 0 depth)
(begin
(define x
(string-append "depth: " (number->string depth)))
(rec-1 (fx- depth 1))
(print x)))))
b) define after let
(define rec-1 (lambda (depth)
(if (fx< 0 depth)
(let ()
(define x
(string-append "depth: " (number->string depth)))
(rec-1 (fx- depth 1))
(print x)))))
chicken tools - reacting to (a):
Chicken 4:
csi: Note: the following toplevel variables are referenced but unbound:
x (in rec-1)
csc (default parameter): no comment
Chicken 5:
csc (default parameter): error
lg
Martin
is it expected behaviour that (a) does not work but (b) does?
a) define after begin
(define rec-1 (lambda (depth)
(if (fx< 0 depth)
(begin
(define x
(string-append "depth: " (number->string depth)))
(rec-1 (fx- depth 1))
(print x)))))
b) define after let
(define rec-1 (lambda (depth)
(if (fx< 0 depth)
(let ()
(define x
(string-append "depth: " (number->string depth)))
(rec-1 (fx- depth 1))
(print x)))))
chicken tools - reacting to (a):
Chicken 4:
csi: Note: the following toplevel variables are referenced but unbound:
x (in rec-1)
csc (default parameter): no comment
Chicken 5:
csc (default parameter): error
lg
Martin