[plt-scheme] Re: How to use a custom procedure as read?

From: Noel Welsh (noelwelsh at gmail.com)
Date: Tue Sep 30 08:12:24 EDT 2008

On Tue, Sep 30, 2008 at 3:45 AM, Ali <emailaliclark at gmail.com> wrote:
>> > (swap-the-reader-in)
>> > ... code using custom reader ...
>> > (swap-the-reader-out)
>> > ... normal reader again ...
...
> Thanks. Do I have to write the code in a module? I'd much rather be
> able to swap in and out of the custom reader mode as with above.

You have to write your code in a separate module.  If you did not,
Scheme would have to evaluate your code as the module was loaded to
work out that you were swapping in a new reader.  This would break a
lot of things, the module system being the prime one.

Note the documentation you are reading is for v4, while you're using
v3.  I suggest you upgrade your installation.

Finally, writing a custom reader is a fairly advanced task.  What is
the problem you're trying to solve?  Perhaps list members can suggest
a simpler way of solving it.

HTH,
N.


Posted on the users mailing list.