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

Add a way to convert ints to strings in interpolation #1241

Open
johnynek opened this issue Nov 1, 2024 · 1 comment
Open

Add a way to convert ints to strings in interpolation #1241

johnynek opened this issue Nov 1, 2024 · 1 comment

Comments

@johnynek
Copy link
Owner

johnynek commented Nov 1, 2024

Something like
"the count is $#{cnt}"

Where to draw the line is a question here though. If we add this, it should also work in pattern matching position, and that complicates string parsing and patterns.

@johnynek
Copy link
Owner Author

johnynek commented Dec 1, 2024

If we imagine these are format strings that are also parsers it seems somewhat compelling.

Maybe "$c{x}$i{y}$f{z}"

To print or parse characters, integers and floats.

I like the idea, but have to be a bit careful about string totality checking. I guess you can just always assume it is refutable.

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

1 participant