Skip to content

Some channel functions have problematic names #107

@ivan-cukic

Description

@ivan-cukic

The functions like zip, join and similar in this library have different meanings compared to some other C++ and non-C++ libraries that model similar or same concepts.

This issue is based on the presentation from Meeting C++ 2017, I haven't checked whether the implementation follows what was presented there.

These are naming collisions against Eric's range-v3 library since those names will become a part of STL at some point, and having the functions with the same names and completely different meanings will be problematic for this library:

  • zip should create pairs (tuples) of values from the source channels, not interleave them (round robin)
  • join flattens out range of ranges in range-v3 (joining is a usual term for flattening out nested monads) - here, the equivalent would be to have a channel<channel<T>> and to get a channel<T>

Proposal:

  • change zip to create pairs/tuples
  • make a join function that flattens out nested channels, or remove join function from the library
  • merge should accept the merging strategy as an argument - should it be round-robin or unordered (emit whichever value comes first regardless of the source channel) - instead of having to invent different names for all different functions that perform merging and forcing the user to check out the documentation to know which one does what.

p.s. I don't usually comment on APIs (backwards-compatibility and all), but Sean told me the API is not yet considered stable and that there is time for the things to get fixed.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions