Use lists:foreach because result is ignored

This commit is contained in:
Tuncer Ayaz 2012-06-30 23:17:22 +02:00
parent 385e3f09ba
commit fd0697239d

View file

@ -62,16 +62,17 @@
%% Build a list of available templates %% Build a list of available templates
AvailTemplates = find_disk_templates() ++ find_escript_templates(), AvailTemplates = find_disk_templates() ++ find_escript_templates(),
?CONSOLE("Available templates:\n", []), ?CONSOLE("Available templates:\n", []),
_ = [begin lists:foreach(
BaseName = filename:basename(F, ".template"), fun({Type, F}) ->
TemplateTerms = consult(load_file(Type, F)), BaseName = filename:basename(F, ".template"),
{_, VarList} = lists:keyfind(variables, 1, TemplateTerms), TemplateTerms = consult(load_file(Type, F)),
Vars = lists:foldl(fun({V,_}, Acc) -> {_, VarList} = lists:keyfind(variables, 1, TemplateTerms),
[atom_to_list(V) | Acc] Vars = lists:foldl(fun({V,_}, Acc) ->
end, [], VarList), [atom_to_list(V) | Acc]
?CONSOLE(" * ~s: ~s (~p) (variables: ~p)\n", end, [], VarList),
[BaseName, F, Type, string:join(Vars, ", ")]) ?CONSOLE(" * ~s: ~s (~p) (variables: ~p)\n",
end || {Type, F} <- AvailTemplates], [BaseName, F, Type, string:join(Vars, ", ")])
end, AvailTemplates),
ok. ok.