chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] (declare (block))


From: Shawn W.
Subject: [Chicken-users] (declare (block))
Date: Wed, 2 May 2007 11:57:08 -0700

The documentation for (block) says that it indicates that global variables are never redefined. Does that mean that I can't then load a unit that redefines some standard function and have the new definition work? Or does it mean that other files that load this unit can't redefine its variables and have those changes reflected in it?

What about things like the

(define incr # f)
(let* ((counter 0)
          (real-incr (lambda () (set! counter (+ 1 counter)) counter)))
        (set! incr real-incr))

trick for hiding static variables that persist across function calls? I'd assume that that would fail because it alters a global variable, but it seems to work in some testing I'm doing.

So what does block actually do?

Thanks.

--
Shawn W.
address@hidden







reply via email to

[Prev in Thread] Current Thread [Next in Thread]