I can't think of a single instance where iterating in reverse is even
necessary. If you're deleting elements of a collection, simply build a new
collection of the ones you want to delete. If you do it right, that's
easier to read, anyway.

Doug

On Sat, May 2, 2020 at 12:10 AM Aparajita Fishman via 4D_Tech <
[email protected]> wrote:

> > "Don’t be so quick to complain; you finally got ‘for each’ 10 years after
> > the rest of the world (including Active4D).”
> > Good point. So…you’re thinking that the feature set is complete?
>
> Absolutely. In fact it is more complete than most implementations, you can
> specify and begin and end index for ordered collections.
>
>
> > "I don’t know of a single language (and I have used at least 6) where
> ‘for
> > each’ is reversible.”
> > This could be 4D’s chance to be a trendsetter!
>
> I don’t think it's worth it. Iterating in reverse is not a common
> operation.
>
>
> > it’s funny that we have such a handy looping construct yet I have write
> > code to init and update my own index.
>
> If you need an index in a ‘for each’ loop, you should actually be using an
> indexed ‘for’ loop. That’s the point of having ‘for each’ separate from
> ‘for’: 90% of the time you don’t need the index and ‘for each’ is more
> concise, but when you need an index a for loop increments it for you.
>
> - Aparajita
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to