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

Re: Module hierarchies, aliasing, and dependencies

On Sep 10, 10:35pm, Zefram wrote:
} Subject: Re: Module hierarchies, aliasing, and dependencies
} [E.g.] zsh/deltochar depends on zsh/zle: with dependencies set up right,
} zsh/zle will be loaded automatically before zsh/deltochar.  But if you
} load zsh/deltochar under the name "local/deltochar" (or just "deltochar",
} or anything else) zsh/zle won't be loaded first, and so the load will fail
} (unless zsh/zle was already loaded).

I don't think this is really a problem -- the issue is not automatically
discovering that local/deltochar depends on zsh/zle, it's discovering that
local/zle has already substituted for zsh/zle when loading zsh/deltochar.

Put another way, I'm quite happy to have to explicitly state dependency
of local/deltochar on zsh/zle, external to any module.  However, if the
user explicitly loads local/zle, I want zsh to discover that it does not
also need to load zsh/zle at the time zsh/deltochar is loaded.

An alternate solution has just occurred to me ... in the setup function in
local/zle, one could simply scan the module list for any module that has a
dependency on zsh/zle, and substitute the name local/zle in its place.
However, that would not help if `zmodload -d ... zsh/zle' was used after
the local/zle setup function was called, so some additional magic would
also be needed.

} There's another issue that on some systems name clashes between symbols
} exported by different modules isn't permitted, so every module's boot
} function has to be named differently, so we need to know the module's
} internal name in order to call any code in it.  Loading under a different
} name just won't work on that kind of system (as I mentioned upthread).

Under what circumstances would it be necessary to call any code without
knowing the actual name of the shared object?

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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