Recursive list comprehension

Peter-Henry Mander erlang@REDACTED
Fri Jan 13 08:26:29 CET 2006


Hi Joel,

Without more context, it's hard for me to see how this code terminates.
What is the termination clause in this recursive function?

And I doubt very much that it is tail recursive. It looks as if this
function will consume vast amounts of memory if the calculation is long.

Pete.

On Fri, 2006-01-13 at 00:35 +0000, Joel Reymont wrote:
> Folks,
> 
> I'm trying to build a search space for future analysis. Does this  
> look valid to you?
> 
> transition(State) ->
>      [{[Move] ++ Moves, Cost + Cost1} ||
> 	{State1, Move, Cost} <- move(State),
> 	{Moves, Cost1} <- transition(State1)].
> 
> 	Thanks, Joel
> 
> --
> http://wagerlabs.com/
> 
> 
> 
> 
> 
> 





More information about the erlang-questions mailing list