[plt-scheme] custom reader

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Fri May 23 19:22:49 EDT 2008

Yes, you can do that. Typed-Scheme is a good example to start with, but 
as I just checked, it is for v3xx instead of v4. The idea is to have a 
module that provides two function: read and read-syntax (in v372).

In v3.99 doc "Plugins: Extending DrScheme", section 2.1 Adding 
Module-based Languages to DrScheme, it is mentioned: 
drscheme-language-readers: This is optional. If present, it must be 
bound to a quoted list of module specifications (that is, a quoted 
version of the argument to require). Each specification must be a module 
that exports a function named read-syntax. Each of these read-syntax 
functions must match MzScheme’s read-syntax primitive’s contract, but 
may read different concrete syntax.


Robert Nikander wrote:
> Hi,
> I hear you can define a custom reader for a custom language, to use like:
> #lang my-language
> Does documentation exist yet for doing this? Or examples?
> I looked at collects/swindle, because I noticed it parsed :keywords, 
> but all I see is a minimal file in lang/reader.ss that makes no sense 
> to me.
> thanks,
> Rob

Posted on the users mailing list.