aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorPierre Fenoll <[email protected]>2013-12-29 18:03:45 +0100
committerPierre Fenoll <[email protected]>2014-03-11 16:51:49 +0100
commit6b705ee68e31a07c4547e8d15350472fe54e99ee (patch)
treebf1e6056b0cd2816a84626fede92118b912623dc /lib/stdlib
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-6b705ee68e31a07c4547e8d15350472fe54e99ee.tar.gz
otp-6b705ee68e31a07c4547e8d15350472fe54e99ee.tar.bz2
otp-6b705ee68e31a07c4547e8d15350472fe54e99ee.zip
Replace local mapl/2 (Erlang < 5.0) unique call by a LC
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/erl_parse.yrl21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 7145b0858f..0be6e481b0 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -803,10 +803,12 @@ build_fun(Line, Cs) ->
{'fun',Line,{clauses,check_clauses(Cs, 'fun', Arity)}}.
check_clauses(Cs, Name, Arity) ->
- mapl(fun ({clause,L,N,As,G,B}) when N =:= Name, length(As) =:= Arity ->
- {clause,L,As,G,B};
- ({clause,L,_N,_As,_G,_B}) ->
- ret_err(L, "head mismatch") end, Cs).
+ [case C of
+ {clause,L,N,As,G,B} when N =:= Name, length(As) =:= Arity ->
+ {clause,L,As,G,B};
+ {clause,L,_N,_As,_G,_B} ->
+ ret_err(L, "head mismatch")
+ end || C <- Cs].
build_try(L,Es,Scs,{Ccs,As}) ->
{'try',L,Es,Scs,Ccs,As}.
@@ -816,17 +818,6 @@ ret_err(L, S) ->
{location,Location} = get_attribute(L, location),
return_error(Location, S).
-%% mapl(F,List)
-%% an alternative map which always maps from left to right
-%% and makes it possible to interrupt the mapping with throw on
-%% the first occurence from left as expected.
-%% can be removed when the jam machine (and all other machines)
-%% uses the standardized (Erlang 5.0) evaluation order (from left to right)
-mapl(F, [H|T]) ->
- V = F(H),
- [V | mapl(F,T)];
-mapl(_, []) ->
- [].
%% Convert between the abstract form of a term and a term.