[erlang-questions] Why we need a -module() attribute?

Bengt Kleberg <>
Wed Feb 24 08:27:09 CET 2016


Greetings,

Would it be possible to get a more elaborate explanation of what OASES 
would do?

Given the {module, my_app_part_subpart, "src/myapp/part/subpart.erl"} 
example below, would src/myapp/part/subpart.erl be available as the 
module my_app_part_subpart after being loaded in the VM?
How would src/myapp/part/helper.erl refer to it: my_app_part_subpart or 
subpart or ???
How would src/myapp/other/subpart.erl refer to it: my_app_part_subpart 
or part_subpart or ???


I  do not understand the "zip" thing enough to ask about it.


bengt

On 02/24/2016 12:46 AM, Richard A. O'Keefe wrote:
>
>
> On 24/02/16 7:12 am, Judson Lester wrote:
>> For a while now, I've wished I could have more control over where 
>> module source files were on the filesystem. For example, instead of
>>
>> src/myapp_part_subpart.erl:
>> -module(myapp_part_subpart).
>>
>> I'd really like to be able to put that in src/myapp/part/subpart.erl
> That's pretty much what GHC does for Haskell; see
> https://downloads.haskell.org/~ghc/7.0.1/docs/html/users_guide/separate-compilation.html 
>
>
> I find it a pain in the --s- (and more so in Java) because you end up 
> with one
> conceptual collection shotgunned across a fairly arbitrary set of 
> directories.
>
> We have the notion of an OASIS catalogue for SGML and XML.
> I've used the acronym OASES without explaining it before:
>   Organising Application Sources for Erlang Safely
> At a minimum, a myapp.oases file could contain things like
> {module, my_app_part_subpart, "src/myapp/part/subpart.erl"}.
> It could allow things like
> {module, my_app_otherPart, {zip,"src/myapp/lib.zip","otherPart.erl"}}.
>
> There'd be a 'finderl $module' command that you could use to find
> the file name corresponding to a particular module.
>
> I have a half-written web page about this; it's definitely not ready 
> to put up yet.
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list