summaryrefslogtreecommitdiff
path: root/lib/stdlib/src/qlc.erl
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2012-11-12 10:02:58 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2013-12-12 12:46:31 +0100
commitad882c4ae17d23fd0ce0affbf2cccefc264de6a9 (patch)
treefe141b9f249c3eae2c76c3fc5f7f931cc45b57c9 /lib/stdlib/src/qlc.erl
parent8261c96c35d0691dc2619456a29ee41c1b944b1c (diff)
downloaderlang-ad882c4ae17d23fd0ce0affbf2cccefc264de6a9.tar.gz
Support named funs in the shell
The current code for the evaluation of ordinary funs is dependent on the order on variables in the fun environment as returned by erlang:fun_info(Fun, env). To avoid the problem in the future, make sure that we only have one free variable in the funs that we will need to inspect using erlang:fun_info(Fun, env).
Diffstat (limited to 'lib/stdlib/src/qlc.erl')
-rw-r--r--lib/stdlib/src/qlc.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/stdlib/src/qlc.erl b/lib/stdlib/src/qlc.erl
index 48f6622565..002032d48d 100644
--- a/lib/stdlib/src/qlc.erl
+++ b/lib/stdlib/src/qlc.erl
@@ -1266,6 +1266,8 @@ abstr_term(Fun, Line) when is_function(Fun) ->
case erl_eval:fun_data(Fun) of
{fun_data, _Bs, Cs} ->
{'fun', Line, {clauses, Cs}};
+ {named_fun_data, _Bs, Name, Cs} ->
+ {named_fun, Line, Name, Cs};
false ->
{name, Name} = erlang:fun_info(Fun, name),
{arity, Arity} = erlang:fun_info(Fun, arity),