Jörg F. Wittenberger wrote:
For pure chicken code this maybe correct.
But some Scheme implementations happen to treat the former form as a
global variable, which can be set! later on, while the latter is
beeing
compiled into a static binding and set! on it will raise an error.
Thanks for this clarification, I didn't know that.
However, since I only seldomly use set! on functions, I guess I'd
prefer the latter form anyway.
One notable exception is this (disgusting?) idiom I invented for
making generators without call/cc yield:
(define (fib)
(let loop ((a 1) (b 1))
(set! fib (lambda () (loop b (+ a b))))
a))
;; maybe non-portable outside of current chicken semantics?