Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: hierarchical module names

Zefram wrote:
> 3. Have alias modules for the historically-established names.  We'd have,
>    for example, a `zle' module, which has a built-in dependency on
>    `zsh/zle' but doesn't actually do anything itself.  So loading `zle'
>    would have the effect of loading `zsh/zle', and zmodload would then
>    report both `zle' and `zsh/zle' as loaded.
> I favour solution 3.  It seems to maintain the greatest degree of
> compatibility, while not requiring any changes to the mechanism.

Perhaps we don't even need the aliased modules (though I don't quite know
how you'd plan to implement this anyway).  zmodload could have a builtin
aliasing feature that says that zle is really zsh/zle; the relevant aliases
are set up.  (This is at a low enough level that `zmodload -e zle'
etc. work too, of course.)  If you could do the same thing with zmodload,
it would be a neat way of tricking zmodload for testing etc. --- e.g. you
unalias foo from standardmods/foo and alias it to testingmods/foo, then
anything which uses module foo still works with the other module, no fpath
trickery.  This is how Stroustrup envisaged namespaces in C++ working, so
we'd be in quite good company.

I'll hold off sticking the patch into the development versions until some
sort of backward compatibility has emerged.

Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>

Messages sorted by: Reverse Date, Date, Thread, Author