[erlang-questions] compile transforms which change the module name
Thomas Lindgren
thomasl_erlang@REDACTED
Mon Jul 20 18:37:10 CEST 2009
----- Original Message ----
> From: Joe Armstrong <erlang@REDACTED>
>
> > - what about M:F() calls and M:F/A references sent as data?
>
> Will break existing code - we need a new bif Mod1 = theModName(Mod)
> which converts a module name like "lists" into the correct version "424acfe..."
I'd suggest you generate that BIF/function when you are building your big module.
>
> > - updating a comment will invalidate the map...
>
> Yes - I'm not sure about this. I could make a check sum from
> epp:parse_file then remove the
> line numbers.
You mean hashing after normalizing line numbers (e.g., setting them all to zero)? That worked well for a similar application, when applied to record definitions. (The goal at that time was to transparently permit many clashing record declarations, included from all sorts of places not known at compile-time, to coexist.)
> > - it would be nice to have tools to do the reverse transformation for
> > logs and error messages; also, to be able to find the right version of
>
> my_origonal_name() ->
> xxxx.
Note that if you are merging modules, this approach _will_ encounter name clashes.
Best,
Thomas
More information about the erlang-questions
mailing list