[erlang-questions] The Beauty of Erlang Syntax

Zvi <>
Thu Feb 26 21:04:49 CET 2009

to be future-proof and GPU-compatible, you need to define
foreach/fold_NDrange, where NDrange is N-dimensional space :)

Michael Radford-3 wrote:
> Hynek Vychodil writes:
>> But anyway, how often you need do something N times without take care for
>> result for *practical* purpose? I think you choose wrong example ;-)
> Off-topic, but it's funny there are no standard library functions
> (AFAIK) that simply iterate over a range of integers.
> The common idiom seems to be to use lists:seq and a list iterator
> function like lists:foreach or lists:foldl.  Which, I will preemptively
> agree, is clear and efficient enough for most purposes.  (Is the
> compiler smart enough to optimize away the construction of the list of
> integers in cases like that?)
> But still, if there were standard functions like these I would use them
> all the time:
> 	foreach_range (fun (I) -> ... end, 1, 10)
> 	foldl_range (fun (I, Acc) -> ... end, Acc0, 1, 10)
> Mike
> _______________________________________________
> erlang-questions mailing list
> http://www.erlang.org/mailman/listinfo/erlang-questions

View this message in context: http://www.nabble.com/The-Beauty-of-Erlang-Syntax-tp22179816p22232485.html
Sent from the Erlang Questions mailing list archive at Nabble.com.

More information about the erlang-questions mailing list