Comments (2)
Consumer specification, after lots of rumination. These are attributes of the object to be passed to the defineConsumer
function.
summary
- same as sequence types
docs
- same as sequence types
tests
- same as sequence types
converter
- same as sequence converter
attribute, but applies to consumers instead
constructor
- same as sequence types
pushFront
- push an element from the front of a sequence
pushBack
- push an element from the back of a sequence (optional!)
pushEnd
- inform the consumer that there are no more elements to push
done
- return true
when the consumer either matched or didn't match the subject
match
- return true
when the consumer matches the subject
copy
- return a copy of this consumer
The distinction between done
and match
is slightly weird:
done
is true
when the consumer won't accept more elements. It means either, "I've matched a complete pattern and if you push any more I will stop matching it", or "I've failed to match the pattern and nothing you push now will change it"
match
is true
when the consumer matches the subject. It does not necessarily imply that, after pushing another element, the consumer will no longer match it. To get the full (longest) match of a consumer, one should keep pushing until done
is true and use the most recent element where match
was once true to be the end of the match. (If match
was never true, then there is no match at all.)
from higher.
Consumers should also support reversing where possible
from higher.
Related Issues (20)
- Prevent cyclic object references from causing isEqual to produce a call stack overflow error HOT 2
- All or most functions currently throwing a NotBoundedError should be able to instead express the requirement in their arguments object HOT 1
- Add new sequence type to support mapIndex function
- Assign unsupported sequence methods to undefined instead of null
- Improve how sequence converters are given priority ordering
- Add arithmetic mean and median functions
- Add chunk sequence implementation optimized for slicing unbounded inputs
- Implement index and slice methods for RoundRobinSequence
- Add functions for making deep and shallow copies of objects HOT 1
- hi.func(sequence) and sequence.func should always have the same behavior
- Remove reset and left methods from all sequences
- Add optimized ngrams sequence for unbounded slicing input sequences
- More complete support for indexNegative, sliceNegative, sliceMixed sequence methods
- Split functions and returned sequence types in test/sequenceTools.js into separate files HOT 3
- Stop causing errors when consuming unbounded sequences
- Investigate optimized implementations for single-length chains
- Add tests for addSequenceConverter
- Rewrite startsWith and endsWith to accept consumers HOT 1
- Add consumer converter for regular expressions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from higher.