site-erlang hack
Luke Gorrie
luke@REDACTED
Tue Jan 28 00:32:12 CET 2003
Ahoy,
I just did a small hack that really didn't turn out as well as I'd
hoped, but I'm posting it anyway :-)
I'm trying to untangle the mess of directories added to my code path
from my ~/.erlang. For example I have three unrelated modules called
'test' in my load path, not counting the 'test' module in our source
tree at work :-)
I just did a quick-and-dirty port of the basic Emacs Lisp code-loading
idea, so you say:
site_code:require(xmerl).
and it looks for xmerl/ebin/ in ~/site-erlang/ or other configurable
places, adds it to the path, and calls xmerl:site_init() if that
function exists (and it can require other packages, etc.)
The idea was to keep unneeded stuff out of my path, so if a program
says require(erlrpc) it only gets the erlrpc/ebin/, and not the other
copy of erlrpc in my NFS server's source tree :-)
But in the cold light of evening it looks pretty low tech compared
with namespaces from a hierarchical packaging system. What's the
status of that now?
Anyhow, here's the code incase someone has an idea to make it right:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: site_code.erl
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20030128/54c9f820/attachment.ksh>
More information about the erlang-questions
mailing list