Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (28 sloc) 0.684 kB
bd33333 forgot to add new files
uwiger authored
1 -module(ct_expand_test).
2
3 -export([f/0]).
4
5 -compile({parse_transform, ct_expand}).
6 -pt_pp_src(true).
7
8 f() ->
9 ct_expand:term(
10 [{a, 1},
11 {b, ct_expand:term(
12 [{ba, 1},
13 {bb, ct_expand:term(2)}])}]).
a58d7da @uwiger nicer error reporting; more capable ct_expand
authored
14
15 %% expand a term which calls a local function - even one which uses a fun reference.
16 g() ->
17 ct_expand:term(zip([1,2], [a,b])).
18
9116c6e @uwiger figured out how to abstract erl_eval funs
authored
19 h() ->
20 ct_expand:term(wrap(my_fun())).
21
22 i() ->
f84867a @uwiger fix function_clause crash in exprecs + minor fixes
authored
23 ct_expand:term(gb_trees:insert(a_fun, my_fun2(), gb_trees:empty())).
a58d7da @uwiger nicer error reporting; more capable ct_expand
authored
24
25 zip([H1|T1], [H2|T2]) ->
9116c6e @uwiger figured out how to abstract erl_eval funs
authored
26 F = my_fun2(),
a58d7da @uwiger nicer error reporting; more capable ct_expand
authored
27 [{F(H1),F(H2)} | zip(T1, T2)];
28 zip([], []) ->
29 [].
30
31 wrap(X) ->
32 {X}.
33
34 my_fun() ->
35 fun() -> foo end.
36
9116c6e @uwiger figured out how to abstract erl_eval funs
authored
37 my_fun2() ->
38 fun wrap/1.
Something went wrong with that request. Please try again.