[erlang-questions] Accumulators..

Vance Shipley vances@REDACTED
Tue Oct 26 03:10:32 CEST 2010


On Mon, Oct 25, 2010 at 08:54:05PM -0400, rgowka1 wrote:
}  My question is - Is there a way to generalize and extend the use of
}  accumulators? 

Your accumulator can be a more complex Erlang term than a list.

     foo(Arg) ->
     	foo(Arg, gb_tree:empty()).
     
     foo(Arg, Acc) ->
     	...
     	foo(Next, gb_tree:insert(Key, Val, Acc)).

-- 
	-Vance


More information about the erlang-questions mailing list