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

fix: printing Var(27) and beyond overflowed ASCII #55

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

AgentElement
Copy link
Contributor

For example, printing Var(27) spits out }, because the character conversion function was basically char(96 + index), thereby overflowing the alphanumeric ASCII section. I've fixed this by encoding the lambda variables in a base 26 string.

Any programs that print out lambda expressions with Var(26) or lower should remain unchanged in behavior.

src/term.rs Outdated Show resolved Hide resolved
src/term.rs Outdated Show resolved Hide resolved
src/term.rs Outdated Show resolved Hide resolved
Copy link
Owner

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

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

I had wondered if someone would ever need that many variables to display, but I'm all for making this possible 😃; I left some suggestions and a question.

@AgentElement
Copy link
Contributor Author

Everything should be resolved now, except for the inverted comparison - I think it makes sense to view depth as an upper bound on i, and move it to the right. I was already changing the original line, so I figured it didn't matter too much.

@AgentElement AgentElement requested a review from ljedrz July 22, 2024 23:57
Copy link
Owner

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@ljedrz ljedrz merged commit c961a86 into ljedrz:master Jul 23, 2024
4 checks passed
@ljedrz ljedrz mentioned this pull request Jul 23, 2024
3 tasks
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