<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When I write code like that (instead of just inlining all the arguments like a good functional programmer), I do that because I want to be able to inspect L1 and L2 in the debugger.</blockquote>
<div><br></div><div>Agreed.</div><div><br></div><div>But its also a problem of Erlang verbosity as compared to say:</div><div><br></div><div>map (1+) $ filter (== 2) [1,2,3,4,2]</div><div><br></div><div>Sometimes its clearer in Erlang to use the sequence method of L1, L2, etc simply so what is happening is more clear then defining a number of anonymous functions or doing:</div>
<div><br></div><div>lists:map(fun(X) -> X +1 end, lists:filter(fun(X) -> X == 2 end, List)</div><div><br></div><div>or</div><div><br></div><div>[X + 1 || X <- lists:filter(fun(X) -> X == 2 end, List)]</div><div>
<br></div><div>Though, my real favorite solution may be for Erlang to be able to do:</div><div><br></div><div>modify_list(List) -></div><div> G(H(List)</div><div> where</div><div> G(List) -> lists:map(fun(X) -> X +1 end, List);</div>
<div> H(List) -> lists:filter(fun(X) -> X == 2 end, List)</div><div> end</div><div>end</div><div><br></div><div>Tristan</div><div><br></div></div>