Skip to content

Introduced template terms, refactored some signatures of public API #9

Merged
Damtev merged 5 commits intomainfrom
damtev/genui_usage_enhancements
Mar 21, 2023
Merged

Introduced template terms, refactored some signatures of public API #9
Damtev merged 5 commits intomainfrom
damtev/genui_usage_enhancements

Conversation

@Damtev
Copy link
Copy Markdown
Member

@Damtev Damtev commented Mar 20, 2023

Improvements:

  • Used a better default value for the Term#isUnifiableWith method - with a javaClass equality, that simplifies introducing new custom terms as sealed classes.
  • Introduced a few template terms - EmptyTerm, UnaryTerm, and BinaryTerm, that simplify introducing new custom terms.

Breaking changes in public API:

  • Signatures of conde and and are changed not to allow passing empty arguments.
  • Methods nil and of in the RecursiveStream are renamed to nilStream and streamOf accordingly.

@Damtev Damtev requested a review from Kakadu March 20, 2023 08:02
Copy link
Copy Markdown
Collaborator

@Kakadu Kakadu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's funny to look how Kanren's indetifiers become longer and longer, while have a spicial 'to' infix function to create Pairs. From this PR it is not obvious, why this renaming make code more readable.

The changes related to BinaryTerm class are OK

@Damtev
Copy link
Copy Markdown
Member Author

Damtev commented Mar 20, 2023

It's funny to look how Kanren's indetifiers become longer and longer, while have a spicial 'to' infix function to create Pairs. From this PR it is not obvious, why this renaming make code more readable.

The changes related to BinaryTerm class are OK

Just like I said, these changes are introduced to make API more similar to Kotlin standard library

@Damtev Damtev merged commit 1768656 into main Mar 21, 2023
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.

2 participants