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

feat(compiler)!: Custom box printing #1713

Merged
merged 4 commits into from
Mar 4, 2023

Conversation

spotandjake
Copy link
Member

This pr adds custom box printing.
Now single argument tuples will be wrinted as Box(1) intead of (1,) given the only safe way to create a single arugment tuple is by using the box primitive.

I am wondering where I would add a regression test for this if needed I couldn't see anywhere, that we were testing print or toString.

Closes: #1620

Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

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

Looking good! One small change, and then I think it'd be good to add one or two tests.

stdlib/runtime/string.gr Outdated Show resolved Hide resolved
@spotandjake
Copy link
Member Author

Looking good! One small change, and then I think it'd be good to add one or two tests.

I was wondering where I would put regression tests for these?

@spotandjake spotandjake self-assigned this Mar 1, 2023
stdlib/runtime/string.gr Outdated Show resolved Hide resolved
@ospencer
Copy link
Member

ospencer commented Mar 1, 2023

You can add tests to compiler/test/suites/strings.re!

spotandjake and others added 2 commits March 1, 2023 12:42
Co-authored-by: Oscar Spencer <oscar.spen@gmail.com>
@ospencer ospencer changed the title feat: Custom box Stringify feat(compiler): Custom box printing Mar 2, 2023
Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

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

Sweet, thanks!

@ospencer
Copy link
Member

ospencer commented Mar 2, 2023

I suppose this is technically breaking.

@ospencer ospencer changed the title feat(compiler): Custom box printing feat(compiler)!: Custom box printing Mar 2, 2023
@ospencer ospencer added this pull request to the merge queue Mar 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 2, 2023
@ospencer ospencer added this pull request to the merge queue Mar 4, 2023
Merged via the queue into grain-lang:main with commit 3c86e45 Mar 4, 2023
av8ta pushed a commit to av8ta/grain that referenced this pull request Apr 11, 2023
* feat: Custom box Stringify

* chore: Refactor Box Change

* Update stdlib/runtime/string.gr

Co-authored-by: Oscar Spencer <oscar.spen@gmail.com>

* chore: Add Regression Tests

---------

Co-authored-by: Oscar Spencer <oscar.spen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom printing for boxes
2 participants