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:<br>
<br>(define-type tagged-data tag data)<br><br>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<br>
<br>so ssuppose I wrote<br>'a 'b 'c 'd 'e to the port<br><br>then when I read from it, I get back<br><br>(make-tagged-data 1 'a)<br>(make-tagged-data 2 'b)<br>...<br>(make-tagged-data 5 'e)<br>
<br>The point of this isn't this particular problem, but to understand what abstractions I need to provide when writing my own ports.<br><br>Thanks!<br>