[erlang-questions] Reassigning variables

Matthew Dempsky matthew@REDACTED
Tue Mar 17 19:21:00 CET 2009

On Tue, Mar 17, 2009 at 11:15 AM, Dale Harvey <harveyd@REDACTED> wrote:
> f(X) ->
>     lists:foldl(fun(F, Last) -> F(Last) end,
>         foo(), [fun whee/1, fun bar/1, fun xyzzy/1]).

I think this in an inadequate solution.  Not all code is as simple as
I described: some functions output multiple values, only one of which
is the new value for X; some functions take arguments other than X;
sometimes other functions need to be called in between the function
calls that update X.

More information about the erlang-questions mailing list