[plt-scheme] changing the behavior of 'read'?

From: Aaron Leung (akhleung at earthlink.net)
Date: Wed May 21 00:51:38 EDT 2003

Hi everyone,

I want to embed an interpreter for a Lisp-like language into a DrScheme 
program.  I'd like to read expressions using DrScheme's 'read', but the 
lexical structure of the embedded language is different from Scheme's.  
Is there a way I can change the behavior of 'read'?  For example:

* when the reader sees [1 2 3], it returns #(1 2 3)
* when it sees #|some symbol|, it returns |some symbol|
* when it sees |, it returns \|
* when it sees ##, it ignores the rest of the line
* etc

I skimmed the section on custon input ports in the MzScheme manual, but 
I found it a little confusing.  Can someone give me an overview of how 
to handle this, or point me to some simple examples?  Thanks for any 


Posted on the users mailing list.