[erlang-patches] Patch to allow parameterized modules in parse transforms
Bjorn Gustavsson
bjorn@REDACTED
Tue Nov 20 07:17:08 CET 2007
"Matthew Dempsky" <matthew@REDACTED> writes:
> The Erlang compiler does not currently allow parameterized modules to
> be used for parse transforms, but only because of a bad atom_to_list
> call. I replaced this with io_lib:format and it seems to work.
I don't want to include this patch as there is no portable way
to use a parameterized module in a compile directive embedded in
a source file.
We might implement another solution for using parameterized modules
as parse transforms later, when/if parameterized modules have become
a support part of the language.
/Bjorn
> --- compile.erl~ 2007-10-31 07:05:39.000000000 -0700
> +++ compile.erl 2007-11-19 14:12:43.000000000 -0800
> @@ -765,7 +765,7 @@
> end.
>
> foldl_transform(St, [T|Ts]) ->
> - Name = "transform " ++ atom_to_list(T),
> + Name = lists:flatten(io_lib:format("transform ~p", [T])),
> Fun = fun(S) -> T:parse_transform(S#compile.code, S#compile.options) end,
> Run = case member(time, St#compile.options) of
> true -> fun run_tc/2;
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-patches
>
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-patches
mailing list