[gambit-list] defining my own input/output ports
lowly coder
lowlycoder at huoyanjinjing.com
Sun Jun 21 23:13:51 EDT 2009
As I get more familiar with Gambit, I find it's notion of ports to be really
really useful. However, I don't know how to create these structures myself.
Can someone point me to some sample code? A really great example would be
something like:
(define-type tagged-data tag data)
then, as a piece of data is written to the output port, it's tagged with a
(increasing number), and when it's read off the input port, it's a piece of
tagged data
so ssuppose I wrote
'a 'b 'c 'd 'e to the port
then when I read from it, I get back
(make-tagged-data 1 'a)
(make-tagged-data 2 'b)
...
(make-tagged-data 5 'e)
The point of this isn't this particular problem, but to understand what
abstractions I need to provide when writing my own ports.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090621/c6e32db0/attachment.htm>
More information about the Gambit-list
mailing list