-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ports #19
Comments
How should this enhancement interact with the existing IO operations? Presumably reading from the port will need to be supported. The minimal set of functions to support only touches on input ports, so is it reasonable to start by supporting input only? |
You'll need to add variants of I would start with input, but it might be good to do the output primitives too. |
* Initial implementation of input ports (#19) * Pack port structure into fewer bytes * Cleanup C code for ports * Reduce code duplicated from char.c * remove TODO * Fix bug in utf8 encoding for of strings The high bits of packed characters in a string were not zeroed before encoding the character. Co-authored-by: David Van Horn <[email protected]>
IO is currently restricted to work only on stdin and stdout, but ports are first-class values in Racket. Add port values as a new, disjoint data type in our language. A port can be represented as a tagged pointer to a fixed-size array that contains a buffer and a pointer to a file handle. This will require some run-time support for opening and closing files. The enhancement should provide support for
open-input-file
,close-input-port
,port?
at least (and maybe some other operations).The text was updated successfully, but these errors were encountered: