Add replace function #75
Labels
effort: moderate
The issue will probably take a single contributor one or two days of work to resolve.
meta: next release
The issue must be resolved before the next version can be released.
type: feature
The issue involves adding new or extended behavior to the software.
Should follow #58
I have some ideas about how to maybe generalize this kind of find behavior with FSMs
You could pass a finder a consumer
A consumer is an object with
consume
andstate
andcopy
methods.consume
accepts a sequence element as an argument and advances the consumer by one element.state
returns one ofactive
,completed
,terminated
. Active is the in-progress state, completed is the successfully-finished state, and terminated is the failed-finished state.copy
forks and makes a copy of the consumer. A consumer could be paired with a finder to find substrings matching some other sequence or to find substrings of consecutive elements matching a predicate, or could be more complicated and do things like detect floating point numbers. A long term goal might be to build these lazy consumer objects from regular expressionsThe
split
function would change to accept a consumer, or a sequence or a predicate to construct a simple consumer from. Same withreplace
when added.The text was updated successfully, but these errors were encountered: