Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2 #14

Merged
merged 7 commits into from
Nov 20, 2023
Merged

0.2 #14

merged 7 commits into from
Nov 20, 2023

Conversation

BenWoodworth
Copy link
Owner

No description provided.

In most cases, an actual parameter (and its state) is what's being talked about. So unless it's specifically the delegate being talked about, change the wording to just "parameter".
This will make it possible to avoid re-calculating independent parameters, enable captured parameters be used only after an iteration completes, and iterate arguments closer to their declaration. See issue #11 for context.

The code was minimally modified to change the behavior, and tests were changed to account for arguments iteration in declaration order instead of usage order (since that's now the order arguments are calculated and depend on each other).
Now that arguments are calculated immediately, there's no intermediate parameter state before initializing. This means a lot of the parameter tracking and argument iteration logic could be simplified. Documentation was also updated to reflect the changes in how the parameter state is represented.

Tests also no longer need to use a parameter to ensure that it's iterated over in the combinations, so a lot of `useParameter` lines could be removed as well.

Additionally, tests that only specify how used/unused parameters behave have been removed, since they are no longer cases that change the behavior, so they don't need to be considered.
Previously the same delegate instance was shared between all iterations, and its argument points to the value in the current iteration. This was fine if the parameter is only used in the current iteration, but if a parameter is captured in a lambda and used later, the argument will change for a future iteration's argument combination, and the value will not be the same as when it was captured.

To fix this, the delegate is now unique to its iteration instead of being shared, and maintains an unchanging argument so that it can be captured and accessed later.

See issue #10 for context.
Since permutation implies an order to the parameters, so combination is more appropriate.
@BenWoodworth BenWoodworth merged commit eeff4aa into main Nov 20, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant