[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
current module fluid
From: |
Jon Wilson |
Subject: |
current module fluid |
Date: |
Mon, 09 Jul 2007 16:49:33 -0400 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070604) |
Hi,
I was poking around the source (guile-core/libguile/modules.c), and
noticed that the current toplevel module is stored in a fluid named (in
C, anyway) "the_module". Is this fluid accessible from scheme? (it does
not appear to be) Is there a good reason why it should not be made
accessible?
If it were accessible, then my load-with-env procedure would be reduced from
(define (load-with-env filename env)
(let ((real-current-module #f))
(dynamic-wind
(λ () (set! real-current-module (set-current-module env)))
(λ () (load filename))
(λ () (set-current-module real-current-module)))))
to
(define (load-with-env filename env)
(with-fluids ((the_module env))
(load filename)))
Much smaller, and simpler. I think it is cleaner, too. So we have a use
case for exposing the_module to scheme. If we don't have reasons not to
expose the_module, then I think we should.
Regards,
Jon
- current module fluid,
Jon Wilson <=