Ulf gave me some pointers on how to prevent ct_expand from emitting these warnings. Basically, ensure that the temporary variables created by ct_expand are prefixed with an underbar. Here's a patch:
--- src/ct_expand.erl 5 Jun 2009 21:07:32 -0000 1.1
+++ src/ct_expand.erl 10 Sep 2009 04:12:07 -0000
@@ -139,6 +139,9 @@
{Fname, Arity} = erl_syntax_lib:analyze_function(Form),
VarNames = erl_syntax_lib:new_variable_names(
Arity,
+ fun (N) ->
+ list_to_atom ("_V" ++ integer_to_list (N))
+ end,
erl_syntax_lib:variables(Form)),
{Form, [{function, Fname},
{arity, Arity},
I'm glad it worked.
ReplyDeleteIf you have time, It'd be great if you could give my new ct_expand a spin.
It shouldn't suffer from this problem at all, and has at least one additional useful feature: optional pretty-printing of the transformed code.
Documentation is catching up, but still leaves something to be desired. Contact me to resolve any confusion that it may cause.