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

Printable data types #124

Open
wilbowma opened this issue Jun 16, 2020 · 3 comments
Open

Printable data types #124

wilbowma opened this issue Jun 16, 2020 · 3 comments

Comments

@wilbowma
Copy link
Owner

I want support for making numbers print like numbers. I can redefine #%datum to get numbers to read like numbers, but want vice versa. Some kind of interface to gen:printable?

@stchang
Copy link
Collaborator

stchang commented Jun 16, 2020

gen:printable would work for runtime. During typechecking, we're printing stx objects, which do not work with gen:printable. That's why we have the generic type methods. Overloading the resugar-type method might work. Do you have an example in mind?

@wilbowma
Copy link
Owner Author

I'd probably want both. I'm working through my demo, and after I define #%datum for the naturals, I type 0 in the REPL and (z) get printed. This is .. okay. Might even be good most of the time. But I'd like to be able to make it print 0.

@stchang
Copy link
Collaborator

stchang commented Jun 16, 2020

Ok, gen:print is fine for the repl. Though define-type currently doesnt let you get at the internal struct definition. We should probably open a separate ticket for Turnstile to do that.

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

No branches or pull requests

2 participants