using the "*" operator for Cartesian product of two collections. #6788
Unanswered
VardanKosakyan
asked this question in
Language Ideas
Replies: 1 comment
-
IMO this is a better use case for an extension method that makes it clear that the result is a Cartesian product. Different people will have different expectations as to what multiplying two collections should mean. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently operator overloading is not supported in extension methods. I believe it will be supported in the future. It is proposed to implement overloaded "*" operator extension for
IEnumerable<T>
, which will realize Cartesian product of two collections. Result of Cartesian product of two collectionsIEnumerable<T1>
andIEnumerable<T2>
will be collection of tuplesIEnumerable<(T1,T2)>
.It will have more beautiful and readable syntax.
example
Beta Was this translation helpful? Give feedback.
All reactions