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

Print special float values as Num.nanF64, etc #6755

Merged
merged 1 commit into from
May 31, 2024

Conversation

andyferris
Copy link
Contributor

Addresses part of #6709. I might need a little bit of help on this one.

My understanding of rust macros is limited - I suspect the f64_helper! and f32_helper! macros could be elided. I was trying to avoid adding a trait just for dispatching on the number printing function at the end.

I also think my usage of Expr::Num("Num.nanF64") is wrong since we aren't actually implementing these as literals - there must be another AST node type for getting something from a module?

There are a few pieces of documentation in Num.roc that could be updated to reflect these changes.

Finally, I wasn't sure if there was any runtime (zig) code for printing numbers as strings that we also want to consider? (Sorry, my understanding of the system as a whole is limited at this stage).

@andyferris andyferris force-pushed the special_float_literals_repl branch from 001e1cc to 51a2781 Compare May 21, 2024 12:12
@andyferris andyferris marked this pull request as ready for review May 21, 2024 12:14
@andyferris
Copy link
Contributor Author

andyferris commented May 21, 2024

OK I've managed to get this running well locally. I am seeing a test failure for cli_run::expects_dev_and_test but I don't see the relationship.

@lukewilliamboswell
Copy link
Collaborator

I rebased on main and can't reproduce the test failure. Let's see what CI has to say 🤷‍♂️

@folkertdev folkertdev merged commit fa526c9 into roc-lang:main May 31, 2024
17 checks passed
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.

None yet

3 participants