Hello, On Mon, Apr 9, 2012 at 3:15 PM, Mike Gran <spk...@yahoo.com> wrote: > Anyway, here's an idea. Let's call the C code for ports 'base ports'. > > 1. Refactor the C reader so that it took on the responsibility of > storing the putbacked (ungotton?) characters. > > 2. This would let you simplify the base ports to make read, write, > and unget into those operations that the underlying device could > provide. During bootstrap, a read-only base file port would error on > unget, for example. Base ports would not longer have pushback buffers. > There would be no such thing as string base ports since they aren't > a device. > > 3. Then you could get through bootstrap and create scheme ports on top > of the base port primitives.
Would it be possible to make this simpler (at least for now) by changing steps 1 and 2 as follows? 1. Refactor ports code so read, write, unget are separate operations with Scheme interfaces (where supported). 2. Define the standard Scheme port type in C, using the read/write/unget primitives, so that the C reader can use it during startup That gives you the flexibility of having the primitives around, but lets you avoid the rewrite of the C reader. Noah