-
Notifications
You must be signed in to change notification settings - Fork 38
Add associative array cartesian products #16
Conversation
This looks great to me. ( I peer reviewed it). It would be really great to get this in. |
Sorry for the delay, I was on vacations :-). |
Since the library is not yet finalized (still in development), we can change the behavior of the cartesian product iterator. Having associated keys sounds good for me. Can you update your patch to modify |
👍 |
Sorry for not yet rolling this; I will get back to you soon. |
BTW http://cgit.drupalcode.org/sandbox-chx-1857558/tree/core/lib/Drupal/Component/Utility/CartesianProduct.php?h=router-new the code is here; the test is http://cgit.drupalcode.org/sandbox-chx-1857558/tree/core/tests/Drupal/Tests/Component/Utility/CartesianProductTest.php?h=router-new here. The code is my work you are free to take it especially because it is very clearly inspired by yours. The constructor takes a different argument if I remember correctly. |
@chx If the code is inspired by Hoa, I would ask you a mention if possible :-). |
That code won't be in Drupal, I believe, it was an aborted attempt, that's why it's in a sandbox. If you can continue from here, please do. I have no problems with a joint authorship -- the basic idea of using iterators for each item and the underlying logic of implementing the advancing loop is certainly yours. The implementation, on the other hand, is mostly mine :) |
I prefer you to continue since we have few resources here ;-). If you don't have time, tell it cleary and we will find time to continue your work and proposal :-). |
I can adjust this for you but I can only do so next weekend. |
@chx Perfect :-). |
@chx ping 😄? |
Sorry! I will do this weekend. |
No hurry :-). It was a simple ping ;-). |
Closing in favor of #23 |
This is a fascinating library to calculate cartesian products without recursion and without keeping the whole set in memory. May I ask for associative array support? If this is not desired, could you at least please consider splitting off the init function so I can add my subclass without copying the whole constructor? Thanks.