Talk:Loops/For with a specified step: Difference between revisions

Content added Content deleted
Line 26: Line 26:
::: [[User:Root|Root]] ([[User talk:Root|talk]]) 13:37, 3 February 2021 (UTC)
::: [[User:Root|Root]] ([[User talk:Root|talk]]) 13:37, 3 February 2021 (UTC)
::::There is a problem with this: even if a language does not have a for/by statement, there may be an idiomatic equivalent that is not a while loop. The most common is probably an iterator/enumerator/generator or whatever you call that, e.g. in Python. Except that the tasks explicitly forbids the case where the enumeration is not suitable to very large ranges, which I suppose means we don't want a solution where we loop other a range that in the background builds a full list of values in memory. Except it's how you do it in R. You also want to delete the R solution? Then we are losing knowledge: how to achieve that task, as idiomatically as possible, even if it's not perfect? [[User:Bastet|Bastet]] ([[User talk:Bastet|talk]]) 16:37, 3 February 2021 (UTC)
::::There is a problem with this: even if a language does not have a for/by statement, there may be an idiomatic equivalent that is not a while loop. The most common is probably an iterator/enumerator/generator or whatever you call that, e.g. in Python. Except that the tasks explicitly forbids the case where the enumeration is not suitable to very large ranges, which I suppose means we don't want a solution where we loop other a range that in the background builds a full list of values in memory. Except it's how you do it in R. You also want to delete the R solution? Then we are losing knowledge: how to achieve that task, as idiomatically as possible, even if it's not perfect? [[User:Bastet|Bastet]] ([[User talk:Bastet|talk]]) 16:37, 3 February 2021 (UTC)
::: Deletion '''very rarely''' adds value.
::: You may find a contribution 'useless' for your purposes, but we really don't need to know that, and it's '''not''' up to you to make that decision on behalf of others.
::: If you genuinely think that you may have spotted one of '''very''' rare cases where a deletion could somehow add significant value, then open that discussion, and see what consensus emerges. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 18:31, 3 February 2021 (UTC)