wanpeebaw
2020-8-3 08:03:07

Wonder why count, sequence-count and stream-count not designed to be consistent.


laurent.orseau
2020-8-3 08:11:38

To me the biggest issue is not so much that the behaviours are inconsistent (though I don’t like it either), in particular because for/friends is so general, but more that it’s not documented (or is it, somehow?).


sorawee
2020-8-3 08:49:04

count operates on lists, where each element is a single value. So consuming multiple lists makes sense. The passed in lambda then consumes n arguments when n is the number of lists.


sorawee
2020-8-3 08:49:26

sequence-count and stream-count operate on streams/sequences where each element could be multiple values. If we want to allow multiple sequences, what would the passed in lambda look like? There’s no good answer. IMO, restricting to one sequence looks most reasonable.


sorawee
2020-8-3 08:52:14

And it’s not that it loses any expressive power. You can always group sequences of single value together via in-parallel, as I shown earlier.


notjack
2020-8-3 09:03:55

this kind of thing is why I’m against multivalued sequences


laurent.orseau
2020-8-3 09:08:35

That said, I’m not going to write a PR for this :sweat_smile: