On 2016-01-07 15:11, Steven Schveighoffer wrote:

With dcollections [1] I had a feature called "purging" where you would
iterate over a collection like this:

foreach(ref bool removeIt, int val; collection)
{
    if(someCondition) removeIt = true;
}

The entire reason for this is because you can do something similar in
C++ containers, and I found it absolutely annoying that the existing
container classes don't allow this. A very frequent use of containers is
to iterate through picking which ones should be removed (think of a cache)

In Ruby that's called "reject", i.e. the opposite of "filter".

--
/Jacob Carlborg

Reply via email to