Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add replace function #75

Open
pineapplemachine opened this issue Jul 17, 2017 · 1 comment
Open

Add replace function #75

pineapplemachine opened this issue Jul 17, 2017 · 1 comment
Assignees
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.

Comments

@pineapplemachine
Copy link
Owner

pineapplemachine commented Jul 17, 2017

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 and state and copy methods. consume accepts a sequence element as an argument and advances the consumer by one element. state returns one of active, 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 expressions

The split function would change to accept a consumer, or a sequence or a predicate to construct a simple consumer from. Same with replace when added.

@pineapplemachine pineapplemachine added effort: moderate The issue will probably take a single contributor one or two days of work to resolve. type: feature The issue involves adding new or extended behavior to the software. labels Jul 17, 2017
@pineapplemachine pineapplemachine self-assigned this Jul 17, 2017
@pineapplemachine pineapplemachine added the meta: next release The issue must be resolved before the next version can be released. label Oct 6, 2017
@pineapplemachine
Copy link
Owner Author

Depends on #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant