[r6rs-discuss] Lexical Syntax
Michael Sperber
sperber at deinprogramm.de
Sun Nov 18 12:50:14 EST 2007
Alan Watson <alan at alan-watson.org> writes:
> William D Clinger wrote:
>> It sounds as though the R6RS has created a need for some
>> kind of tool and/or language that would allow us to read
>> R5RS data reliably and then to write that data reliably
>> as R6RS-readable data.
>
> Such a tool would be trivial to write in R5RS Scheme. It would still be
> worth having, though.
It certainly would be trivial to write in R6RS Scheme. I was able to
hack the R5RS reader and writer that come with Scheme 48 to run in
Ikarus in about 20 minutes. The result is attached. The following R6RS
top-level program then can perform a trivial conversion:
(import (rnrs base)
(rnrs programs)
(prefix (de deinprogramm r5rs-write) r5rs:)
(prefix (de deinprogramm r5rs-read) r5rs:)
(rnrs io simple))
(r5rs:write
(call-with-input-file (cadr (command-line))
(lambda (port)
(r5rs:read port))))
(newline)
It's only a proof-of-concept, with no claims as to its correctness,
completeness, usefulness, or R6RS compliance. To be sure, there's a few
shortcomings, notably the reliance on R6RS's `string->number' in the
reader, which doesn't support '#' anymore, but I'm sure the interested
reader can easily fix that problem. (As well as fixing the 80,000+
other failing test cases a decent test suite can probably be made to
find.)
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20071118/f63bd354/attachment.txt
More information about the r6rs-discuss
mailing list