On May 23, 2007, at 8:37 AM, Dan Muresan wrote:

See make-output/input-port, in the extras unit.

Very nice, I missed it. So I guess if READ and PEEK yield instead of blocking, then that stream plays nicely with threads, just like tcp streams?

I think so. The ##sys#custom-*-port routines do yield. Take a look at the source in "posixunix.scm" Unfortunately it uses sys & core namespace routines, but you can get the idea.


Any thoughts on binary streams?

Not sure what you mean. As opposed to text streams? Or are you talking about bi-directional streams? If so then it would be nice to have but since I have no requirements as yet I really shouldn't speak to it.

Calling read-char repeatedly is probably not efficient; besides, read-char may not be the same as read-byte (if utf8 is loaded).

Actually 'read-byte' uses the builtin 'read-char' when the utf8 egg is loaded. I was wrong about ##sys#custom-*-port not working w/ UTF8, at least in the broader sense. Excellent.


-- Dan

Best Wishes,
Kon



_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to