Skip to content

Add "when" clause to matches to reduce magical incantations #193

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

Merged
merged 1 commit into from
Jun 12, 2022

Conversation

asmaloney
Copy link
Owner

    match {
        goal [add: * ?num2 ?count!?num2 ?sum]
        retrieval [count: ?sum ?next]
    }

becomes:

    match {
        goal [add: * ?num2 ?count ?sum] when (?count != ?num2)
        retrieval [count: ?sum ?next]
    }

This sets us up for #187 if I can figure out how to implement the other constraints in ccm.

goal [add: * ?num2 ?count!?num2 ?sum]

becomes:

goal [add: * ?num2 ?count ?sum] when (?count != ?num2)
@asmaloney asmaloney merged commit 2542a83 into main Jun 12, 2022
@asmaloney asmaloney deleted the when-clause branch June 12, 2022 14:51
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