diff options
author | Björn Gustavsson <[email protected]> | 2011-11-02 10:07:07 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-11-29 14:08:40 +0100 |
commit | ffcfe7ac5fbdd232beb1711012902d712dbb65fe (patch) | |
tree | c64d2adfb4f60b0875705d9461218d9078a8ac86 | |
parent | ab4b10b865980bc9d68b0db9f956855ee9017766 (diff) | |
download | otp-ffcfe7ac5fbdd232beb1711012902d712dbb65fe.tar.gz otp-ffcfe7ac5fbdd232beb1711012902d712dbb65fe.tar.bz2 otp-ffcfe7ac5fbdd232beb1711012902d712dbb65fe.zip |
big_SUITE: Eliminate use of tuple fun
It seems that a tuple fun was used only because erl_eval:expr/3
did not support passing in a real fun at the time that the test
case was originally written.
-rw-r--r-- | erts/emulator/test/big_SUITE.erl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index 3487917677..413bd3bcae 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -26,7 +26,7 @@ shift_limit_1/1, powmod/1, system_limit/1, otp_6692/1]). %% Internal exports. --export([eval/1, funcall/2]). +-export([eval/1]). -export([init/3]). -export([fac/1, fib/1, pow/2, gcd/2, lcm/2]). @@ -162,12 +162,15 @@ multi_match([Node|Ns], Expr, Rs) -> multi_match([], _, Rs) -> Rs. eval(Expr) -> - Fun = {?MODULE,funcall}, - {value,V,_} = erl_eval:expr(Expr, [], Fun), %Applied arithmetic BIFs. - V = eval(Expr, Fun), %Real arithmetic instructions. - V. + LFH = fun(Name, As) -> apply(?MODULE, Name, As) end, + + %% Applied arithmetic BIFs. + {value,V,_} = erl_eval:expr(Expr, [], {value,LFH}), -funcall(F, As) -> apply(?MODULE, F, As). + %% Real arithmetic instructions. + V = eval(Expr, LFH), + + V. %% Like a subset of erl_eval:expr/3, but uses real arithmetic instructions instead of %% applying them (it does make a difference). |