Given that all my Erlang time is spent in LFE and that I'm mostly Erlang-syntax-illiterate, do take this with a grain of salt ;-)
But it seems that the following:
lib_file_name(Lpath) ->
[Lname|Rest] = filename:split(Lpath),
case code:lib_dir(list_to_atom(Lname)) of
Ldir when is_list(Ldir) ->
{ok,filename:join([Ldir|Rest])};
{error,E} -> {error,E}
end.
Could be updated to check for another case, something along the lines of:
case code:lib_dir(list_to_atom(Lname), include) of
...
Given that "include" is a standard name for .hrl, inlcudable .lfe files, etc. This would mean that by simply setting the ERL_LIBS env var, we could have projects including files from other projects...
What do you think?
d