<br><br><div class="gmail_quote">On Tue, May 24, 2011 at 1:21 PM, Tim Watson <span dir="ltr"><<a href="mailto:watson.timothy@gmail.com">watson.timothy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 24 May 2011 11:39, Bengt Kleberg <<a href="mailto:bengt.kleberg@ericsson.com">bengt.kleberg@ericsson.com</a>> wrote:<br>
> Greetings,<br>
><br>
> It would be very nice to have module renaming/namespacing that allowed<br>
> me to do the following:<br>
> The modules "misc_lib" and "misc_lib_helper" from developer A should be<br>
> able to call each other with their original names.<br>
> The modules "misc_lib" and "misc_lib_helper" from developer B should be<br>
> able to call each other with their original names.<br>
> I should be able to call all 4 at the same time with names that I have<br>
> create/renamed.<br>
><br>
> So, I need to load modules as a set/application/??? that renames them<br>
> outside of that set (it would be ok to have the same prefix added to all<br>
> of them), and still allows the files in the set/application/??? to keep<br>
> using to the old names.<br>
><br>
><br>
<br>
</div>I was thinking about this in terms of some kind of special -import or<br>
-alias directive. I think it's possible to do just with a<br>
parse_transform, as long as the set can be fully determined at compile<br>
time. That last point though - therein lies the rub. App-upgrades<br>
change things, and those things can include modules. Dragons.<br>
Nuff-said.<br></blockquote><div><br>It depends upon what -import means.<br><br>-import(foo, [bar/2 ]).<br><br>Where are two interpretations<br><br>a) "when you *run* this program and find a call to foo:bar/2 go and see if you can find the code<br>
for foo, load it then call the function bar/2"<br><br>b ) "When you *compile* this program find the code for foo:bar/2 and<br>extract the code for bar/2 and include it in my code" - in this case you resolve the name at compile time.<br>
<br>I guess when developing a) is useful but when you deploy code it should be b)<br><br>/Joe<br><br><br><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br>