|
From: | Sunnan |
Subject: | Re: [Chicken-users] Re: Style Guide |
Date: | Tue, 06 Nov 2007 15:30:15 +0100 |
User-agent: | Thunderbird 2.0.0.6 (X11/20071022) |
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?
[Prev in Thread] | Current Thread | [Next in Thread] |