[erlang-questions] Nested for-loops, there has to be a better way to do this

Zoltan Lajos Kis <>
Wed Jul 29 21:13:33 CEST 2009


Brentley Jones wrote:
>
> On Jul 29, 2009, at 1:57 PM, Zoltan Lajos Kis wrote:
>
>> And what do I gain using this for function compared to simply writing 
>> an "ad-hoc" recursive function whenever needed ?
>
> Nothing is gained by my bloated, yet modular function. I was just 
> expanding on the modular function listed before mine.
>
>> PS: seriously, is this what the original question was getting at?
>
> I do think it shows how to do nested for loops in a way that looks 
> very imperative, which is what I think the original question was 
> getting at.
>
> On Jul 29, 2009, at 2:55 PM, Yves S. Garret wrote:
>
>> I was playing around with the idea of implementing a nested for-loop
>> like construct (I will concede, they are evil, but at rare times,
>> necessary.)  In non-functional programming languages, they are trivial
>> to do.  However, this has proved to be one of those simple things that
>> are a pain in the neck for me.
But if you look just one sentence further...
"The idea was to be able to pass in a list [5, 5, 10] (for example) and 
go through it all like 3 dimensional array."

Anyway, we should get the answer by dawn (CET) :)

Z.


More information about the erlang-questions mailing list