"Chris K. Jester-Young" <cky...@gmail.com> skribis: > On Mon, Apr 15, 2013 at 10:00:55PM -0400, Mark H Weaver wrote: >> Unfortunately, this is rarely possible in a language like Scheme, where >> calls to procedures bound by mutable top-level variables are frequent. >> We cannot fix this without making most commonly-used top-level bindings >> immutable. Last I checked, there was strong resistance to this idea. > > Maybe it's time to reopen this (and hope it's not a can of worms). :-) > > With a proper module system, I don't see why top-level bindings should > be mutable.
[...] > Yes, this does disable the ability to perform monkey-patching. I don't > see this as a big loss, but perhaps there are legitimate use cases for > monkey-patching that I haven't thought of. Several uses cases would need to be addressed: - Uses of ‘set!’ for bootstrapping purposes as in boot-9.scm (I found myself using a similar idiom in <http://git.sv.gnu.org/cgit/libchop.git/tree/guile2/chop/internal.scm> because I couldn’t come up with another approach.) - Patching, as in <http://git.sv.gnu.org/cgit/guix.git/tree/guix/build/download.scm#n173>, where we’re able to work around a Guile bug without actually bundling a copy of the fixed module. - Live development (with Geiser), as Mark noted. ProofGeneral does something interesting, where evaluated forms become immutable in the file, and have to be “de-evaluated” in reverse order to become mutable again. That provides additional consistency guarantees, but remains far less flexible than what Scheme has to offer. > Another thing we will need to provide is define-values, +1 Thanks, Ludo’.