- Random Access Collection: retrieve member in O(1) time
- Bidirectional Collection
- Default Collection, default, with forward traversal
- Can stride through a number line, regardless of whether that numberline is discrete or continuous
- Can stride over a collection so long as a collection returns a list of indices. The indices may or may not be ordered and the stride may not return the same values over each traversal.
- The user-facing syntax should be the same, regardless of the domain: stride(by) more or less
- There's a presumption that indices are inheretly ordered even when they have no semantic reality that supports that notion
- Protocols do not offer constraints beyond their requirements and do not impose associated semantics.
- Typified by a random number generator. There are no semantics beyond "next member".
- There is no indexing, no memory
- The sequence is uncountable
- Find is not guaranteed to terminate
- For-in is not guaranteed to terminate
- Striding across members occurs in O(stride).
- The members cannot be sorted or shuffled
- You can theoretically 'walk' this with a stride of n by generating and tossing every (n-1) values, producing the nth value. It may mae no sense and have no practical use-case
- Typified by a set.
- The members are unordered. The members may have coincidental index.
- The members are countable. Traversal through the members is guaranteed to terminate
- Find is guaranteed to terminate.
- Accessing members occurs in O(N), iterating members occurs in O(1) for each members, Striding across members occurs in O(stride)
- A stride represents count choose (count / stride)
- The stride output is nominally unique for each time and not determinable
- The members can be sorted and shuffled
- You can test for "contains" and it is guaranteed to terminate
- You can test for isEmpty
- Members are indexed, countable, intrinsically ordered because there's some basis for the indices being countable. For example, the keys of a dictionary can be ordered because they must be hashable, giving dictionaries a basic order even if their common semantics do not support that notion.
- The stride output is fixed for each approach
- Accessing members occurs in O(1)
- Members can be sorted, shuffled
- Collections can respond to isEmpty, count
- The order of retrieval is fixed and will repeat every time.
- The range is discrete
- The stride output is fixed for each approach
- The stride is intrinsically ordered and represents a linear walk in one direction along the number line
- The range can respond to isEmpty and distance
- The interval can be open or closed on each side
- (It's most likely that the starting point represents the edge of that interval, regardless of whether it is open or closed)
- The stride is fixed and the output is fixed, but the math must take into account the limitations of digital representation
- The range can respond to isEmpty an distance
- Every range except the empty one contains an infinite number of potential members. A small subset of these are representable using digital numbers
Which Dave are you referring to? Maybe I’m misunderstanding your “Tao of Dave” but it sounds like the opposite of what I’d say.