Parameterized/Abstract modules

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Wed Mar 9 10:37:11 CET 2005


----- Original Message ----- 
From: "Raimo Niskanen" <raimo@REDACTED>
> I.e. I want to have functions that can be called without being
> parameterized (sp?).

You mean something like "static" functions?

The problem as I see it is that the APIs are usually located in the same file as
the implementation. For abstract modules, it isn't as easy to use, because the
module name is no longer an atom, but has to be passed around in a variable.

Maybe separating the API from the implementation isn't a bad idea even for
normal gen_servers and friends...

Regarding the issue at hand, the compiler could check that the module variables
are not referenced inside that function, and that it only calls such static
functions (or external ones, of course) and generate them in a separate internal
module. Or actually, the parametrized module would be differently named (because
static calls should use the name in the source file).

regards,
Vlad





More information about the erlang-questions mailing list