[erlang-questions] where did my code come from?

Vlad Dumitrescu vladdu55@REDACTED
Tue Sep 13 09:29:01 CEST 2011


Hi!

On Tue, Sep 13, 2011 at 09:19, Joe Armstrong <erlang@REDACTED> wrote:
> When you write code, you have *implicit* knowledge of where the
> external code comes from.
>
> When I write the following:
>
>     -module(foo).
>      ...
>     start() ->
>          X = lists:reverse(...),
>          Y = elib1_misc:zap(...)
>          Z = misultin:request(...)
>     ...
>
> I "know" that lists is part of my local OTP install, elib1_misc is my
> own library installed
> in ~/code/elib2_1/ebin and misultin is an imported project stored in
> ~/imports/misultin
> I also know that my paths etc are setup so this code will work when I
> run the program.
>
> The problem is the *nobody else* knows this.
>
> I could tell the system like this:
>
>    -module(foo).
>
>    -location(lists,
> "https://github.com/erlang/otp/blob/dev/lib/stdlib/src/lists.erl").
>    -location(elib1_misc,
> "https://github.com/joearms/elib1/blob/master/lib/src/elib1_misc.erl").
>    -location(misultin,
> "https://github.com/ostinelli/misultin/blob/master/src/misultin.erl").

While the idea of having explicit references to external libraries is
good, I'm not sure about the way you suggest to do it...

First, should these annotations be found in all modules? Wouldn't that
mean a lot of duplication? I would rather have this information in the
.app file instead.

Second, what about code that isn't available from a public repository?
Then the reference would be meaningless outside the original
environment.

best regards,
Vlad



More information about the erlang-questions mailing list