Sequential Ejection
2024 July 15 at 20:46
Often, a programmer will be faced with a sequence of data from which only certain elements should be retained for further processing. For example, in a game, one might have a list of entities and wish to keep only those that are alive and within the loading zone. Or in a text processing task, one might wish to select only records which begin with a valid date (per ISO 8601) within the past year. This is called a “filter” or “select” operation. We will walk through a few different ways that one might implement this, and discuss the implications of each.