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

[Experimental] Recursion using the Y combinator #3103

Closed
wants to merge 1 commit into from

Conversation

jtran
Copy link
Collaborator

@jtran jtran commented Jul 23, 2024

This is a proof of concept that's not meant to be merged. It implements a fixed-piont combinator, more commonly known as the Y combinator. Using this, we can do recursion in KCL.

I implemented a recursive isEven() function as a test case to prove that it works.

The few things missing that I also implemented were:

  • Short-circuiting OR using ||
  • Logical NOT using !
  • Improved parse error messages

I bumped into a few rough edges of the parser while implementing the Y combinator, but they're already separate issues.

Reference:

Copy link

qa-wolf bot commented Jul 23, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Jul 23, 2024 0:17am

@jessfraz
Copy link
Contributor

should we close since we have not now? will leave to you keep open if not, im just being ocd about stale shit

@jtran
Copy link
Collaborator Author

jtran commented Aug 21, 2024

I will close this, pull out short-circuiting OR and the Y combinator, and make a new PR.

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.

KCL doesn't support negation
2 participants