[erlang-questions] behavior of funktions

Johannes <>
Sun Jul 22 22:25:29 CEST 2007


hi, i have a question about the behavior of funktions.
if theres a function:
f(A,0) ->
	1;
f(A,B) ->
	[f(A,B-1),f(A,B-1)].
how often is f(A,B-1) evaluated then ? just one time, and erlang tooks
the result everywhere where it fits, like f(A,B) -> TMP=f(A,B-1),[TMP;TMP].
or is it evaluated every time again ??

greatz Johannes



More information about the erlang-questions mailing list