[plt-scheme] hooking into the default read handler

From: Hans Oesterholt-Dijkema (hdnews at gawab.com)
Date: Wed Mar 23 17:41:25 EST 2005

Felix Klock's plt proxy schreef:

> On Mar 23, 2005, at 7:37 AM, Hans Oesterholt-Dijkema wrote:
>> In mzscheme, is it possible to define a reader/writer for custom
>> types?
>> Suppose e.g.:
>> (type object-identifier) would be written like: $oid:<number>.
>> Is it possible to add a handler for this type to the default read/write
>> handler functions for 'read' and 'write'?
> I have checked a port wrapping system into PLaneT
> http://planet.plt-scheme.org:80/207.1/newest.html#here-readers.plt1.0
> You could probably turn that into a custom reader, depending on what 
> you mean by "custom"
> (in that, the input format has to look something like a Here-Doc)

That's the point, I don't want to write a complete reader, I'd like to 
hook into
the the default reader with some extra syntax for unknown syntaxes.

I want it to be as cheap as possible to code. It takes a lot of effort 
to code
a complete reader.

> The important bit is how to make read-syntax still work; that was the 
> hardest part of the work I did for the package, at least.
> -Felix
> p.s. and of course, this solution doesn't help you at all with writing 
> these things back out.

Thanks anyway for your help.

Posted on the users mailing list.