[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: REQUIRE
I have strong beliefs about what PROVIDE/REQUIRE should do (at least what
their purpose is in the language).
They are a necessary mechanism for loading needed modules exactly once.
LOAD is inadequate for loading complete subsystems as it becomes very
difficult to make sure you only load something once. I do believe it
should occur at compile-time since many dependencies are at compile-time,
not just during execution. But even if this only covered execution-time
dependencies, the purpose for REQUIRE would be clear. If I access
functions in a module written by someone else, then I need to bring that
module into the system. If I have several optional parts of my system,
then each of my parts may need to make sure that the module is loaded. If
they all used LOAD, multiple copies would be loaded, thus wasting space (at
least in many implementations it would). With REQUIRE, I avoid that, and
also have a way of registering a module for public consumption.
John Diamant
Fort Collins, CO UUCP: {hplabs,hpfcla}!hpfclp!diamant
Hewlett Packard Co. ARPA Internet: diamant%hpfclp@hplabs.HP.COM