[gambit-list] Re: loading modules multiple times
alangley at gmail.com
Thu Aug 11 09:41:56 EDT 2005
On 8/11/05, Christian <christian at pflanze.mine.nu> wrote:
> I'm wondering why you need that patch.
Yes, I could catch the load exception but I don't want to copy and
paste that code into every module. Of course I could that module
loading form into its own module, but then how do I load that?
> Some words about the logic behind the error (from how I see it): load
> on source code can simply reload the source, there's no
> implementation problem with that. It does two things, reparse the
> source (which may have changed), and re-run it's body (which means,
> perform bindings, thus overwriting bindings which may have changed
> since after the first load).
Perfectly true and loading a source file multiple times is just fine.
I recognise the inconsistency between loading source multiple times
and loading a binary multiple times (with this patch); the former
running the body multiple times.
But modules generally pretty quickly reach the point where they stop
changing too often and end up compiled. Many of my .scm files will
start with something like
But, if I do that, then I can't ever create a higher level module
which imports either srfi-1 itself and a lower module, or imports two
lower modules which do.
Questions about design purity are moot while something so simple doesn't work.
chjmodule is a nice bit of code, but is very slow and has far too many
bodges necessitated by Gambit's code.
I can understand that people might want load to retain its original
behaviour and have this called load-once or some such. If there's any
support for this I'll redo the patch.
Adam Langley agl at imperialviolet.org
http://www.imperialviolet.org (+44) (0)7906 332512
PGP: 9113 256A CC0F 71A6 4C84 5087 CDA5 52DF 2CB6 3D60
More information about the Gambit-list