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

always add always_false() clause when tally contains a deduct #414

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

Jamiras
Copy link
Owner

@Jamiras Jamiras commented Sep 13, 2023

The logic:

tally(5, good(), deduct(bad()))

Would generate the code:

SubHits bad()
        good() (5)

This would clamp the number of times good() could be tallied to 5, so if any bad()s were tallied, the logic would never be true.

The correct code would be:

SubHits bad()
AddHits good()
        always_false() (5)

Which allows good() to be tallied more than 5 times to counteract any deductions made by bad(). If There needs to be a limit on good(), it can be wrapped in it's own repeated().

@Jamiras Jamiras added this to the 1.12.2 milestone Sep 13, 2023
@Jamiras Jamiras merged commit 6f42d1b into master Sep 29, 2023
1 check passed
@Jamiras Jamiras deleted the tally_deduct branch September 29, 2023 23:29
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