[erlang-questions] Parameterized module initialization

Vlad Dumitrescu vladdu55@REDACTED
Tue Jun 26 15:14:22 CEST 2012


Hi,

On Tue, Jun 26, 2012 at 2:53 PM, Joe Armstrong <erlang@REDACTED> wrote:
> There is an undocumented way of doing this (which one day will become standard)
> Suppose we define X as follows:
>> X = {mod1, a,b,c}.
> {mod1, a,b,c}.
> X is now an instance of a parameterised module. if we now call the
> function X:func1(x,y) then what actually gets called is the function
> mod1:func1(x,y,{mod1,a,b,c})

I hope that you are expressing some form of sarcasm, Joe.

If I may use such language, it is horrible. Just as we got (almost)
rid of {M,F} to the benefit of proper function references, are we
going to get another kludge? A proper module reference is the way to
go here. Then there are plenty of nice things that can be supported in
a clean way.

best regards,
Vlad



More information about the erlang-questions mailing list