Skip to content
Discussion options

You must be logged in to vote

Data(Charlist) would be represented as {data, "..."}, which is not what the code is actually returning. Instead what you should do is write an erlang wrapper which calls get_line and returns something which can be represented as a Gleam type. The externals documentation may be of help: https://gleam.run/documentation/externals/

I would also recommend converting from a charlist to a binary string so you can perform regular Gleam string operations on the output.

If you just want to get user input, you can also use the input package which has written this FFI for you.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@qmg-tmay
Comment options

Answer selected by qmg-tmay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants