Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Conversation

@butterunderflow
Copy link
Contributor

Cooperative PR with rescript-lang/rescript#5759

@butterunderflow butterunderflow changed the title Char payload Change char payload Oct 28, 2022
@butterunderflow butterunderflow marked this pull request as ready for review October 28, 2022 06:00
let constant f = function
| Pconst_char i -> pp f "%C" i
| Pconst_char i -> pp f "%C" (Char.unsafe_chr i) (* todo: consider safety *)
| Pconst_string (i, None) -> pp f "%S" i
Copy link
Member

Choose a reason for hiding this comment

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

same as above

@butterunderflow butterunderflow marked this pull request as draft October 28, 2022 13:39
| Pconst_char c ->
let str =
match c with
match Char.unsafe_chr c with
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's still a unsafe_char usage, but I think this one is safe because it's just value testing and no I/O is involved.

Copy link
Member

Choose a reason for hiding this comment

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

It seems okay, but there may be some duplication with string_of_int_as_char, you may do a clean up later after this commit landed

Copy link
Member

@bobzhang bobzhang left a comment

Choose a reason for hiding this comment

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

looks good to me

@butterunderflow butterunderflow marked this pull request as ready for review October 31, 2022 02:53
@bobzhang bobzhang merged commit c6807e8 into rescript-lang:master Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants