Tail/Non tail recursion

Vance Shipley vances@REDACTED
Thu Aug 28 16:42:41 CEST 2003


On Thu, Aug 28, 2003 at 03:56:05PM +0200, WILLIAMS Dominic wrote:
}  
}  comprehension(Numbers)->
}  	[X*X||X<-Numbers].
}  


List comprehensions rule.  For anyone relatively new to Erlang; 
if you haven't used a list comprehension yet you should have.
Learn it now, you'll be glad you did.  With list comprehensions
you can avoid writing complete functions and inline a single 
line in your code instead.  The fact that the comprehension 
version won this particular shootout is a bonus.

	-Vance



More information about the erlang-questions mailing list