[erlang-questions] suggestion: shorthand functions

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Fri Jan 11 11:58:14 CET 2013


On Jan 11, 2013, at 10:12 AM, Ulf Wiger <ulf@REDACTED> wrote:

> Comments?

In the Standard ML module system, in particular with the .MLB file extension you get module-level import renaming:

local
  $(OTP_LIB)/R15B % Grab *that* version of the Erlang OTP library
in
  module file = f
  module filename = fn
  module lists = l
end
% From here on out in our build specification, the modules f, fn and l are specified.
your_module.erl

Note that this also solves module clashes:

local
  file1.erl
in
  module file = f1
end
local
  file2.erl
in
  module file = f2
end
…

Do note, however, that Standard ML did *not* make the--unfortunately ubiquitous--mistake of conflating a filename with a module name. So it may be hard to pull off in Erlang-land :/ 

Jesper Louis Andersen
  Erlang Solutions Ltd., Copenhagen






More information about the erlang-questions mailing list