[Nickle] Artificial distinction between import and autoimport
bart at po8.org
Sat Feb 2 23:56:13 PST 2008
In message <1201943342.19008.47.camel at koto.keithp.com> you wrote:
> On Fri, 2008-02-01 at 19:41 -0800, Bart Massey wrote:
> > In a Nickle program intended to be invoked externally, you'd
> > typically just say
> > autoimport Socket, File, Process;
> Sure, but why 'autoimport' instead of just 'import'? There's no reason
> to make the user know what is included in the base system and which
> parts are external. We should be able to uniformly replace 'autoimport'
> with 'import' and have things 'just work'. Similarly, it would be nice
> to have 'load' have the same trick of looking for the conventional file
> for a specific namespace.
I'm not getting it. The important distinction between
autoimport and import is that autoimport won't clobber an
existing namespace from an external file, but import will.
This is also the distinction between autoload and load.
If you want to have a version of load that takes a
namespace-name instead of a filename, I suppose that's
useful; I'd prefer to give it yet another name, though,
rather than be polymorphic. But I'm not getting what you
propose to have your revised import or load do if their
namespace target already exists. Should they replace the
namespace, or stop? Both behaviors have sensible use cases
I described previously, so I'm not sure how to make it "just
work". Perhaps you want load and import to behave
differently at the command prompt vs in a loaded file?
More information about the Nickle