Skip to content

How can I read a single line of text that is longer than 1023 characters? #571

Answered by TimWhiting
shogo314 asked this question in Q&A
Discussion options

You must be logged in to vote

You can keep reading (call the function again), but I guess the more specific question you'd have is knowing whether you've read all the stdin / line yet right, since there is no flag letting you know if it read a full line.

For now you can create your own c function that does what you want, and link to it from Koka: Here is all the definitions from std/os/readline.kk, std/os/readline-inline.c, and the kklib c library os.c where this all is implemented.

Extern imports, extern functions etc, are not limited to the std core libraries. You can use them in your code. (kklib.h and all of the imports / types defined in your module are defined prior to your c file is spliced in, so you shouldn't…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shogo314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants