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 putChar and getChar primitives #6

Open
christian-public opened this issue Aug 30, 2020 · 0 comments
Open

Add putChar and getChar primitives #6

christian-public opened this issue Aug 30, 2020 · 0 comments
Labels
good first issue Good for newcomers

Comments

@christian-public
Copy link
Owner

christian-public commented Aug 30, 2020

I noticed that I have forgot to add the putChar and getChar primitives.

They are available in the Prelude.IO module as %foreign primitives: https://github.com/chrrasmussen/Idris2-Erlang/blob/master/idris2/libs/prelude/Prelude/IO.idr#L63-L66

The implementation would go here: https://github.com/chrrasmussen/Idris2-Erlang/blob/master/idris2/src/Compiler/Erlang/Codegen/NamedCExpToErlExpr.idr#L492-L498, and would be similar to the existing prim__putStr and prim__getStr.

In the Erlang code generator, Char represents a grapheme (and not just a codepoint), which means these functions should handle any Unicode character.

@christian-public christian-public added the good first issue Good for newcomers label Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant