in reply to Re (tilly) 6: How do I remove an element from any array while iterating over it in a loop?
in thread How do I remove an element from any array while iterating over it in a loop?

I am perfectly aware of the fact that it is just a special case, the summary was not needed I didn't intend to sound like I was talking down to you, if that's how it came across. And I'm sure you know the syntax...but lots of people are reading this thread, not just you and me.

And furthermore the request was explicitly not a case of modifying elements, it was a straight filtering operation. Sorry, I missed that, typing replies while waiting on compiles. I thought he was doing a bunch of stuff with the element, and sometimes wanted to remove it as well. I guess he didn't need to be so complicated.

Given that, I agree: to delete items that match a test, grep for the inverse of that test.

—John

  • Comment on Re: Re (tilly) 6: How do I remove an element from any array while iterating over it in a loop?