[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Requested changes to R4RS
About the SYMBOL-VALUE mail. I was wrong. Thinking about it, however,
has led me to the following question: Does the specification require
that LOAD use READ? Should it? Similarly, should READ be required to
be based on READ-CHAR and PEEK-CHAR?
Consider the problem of having a meta-language to describe concisely
something that has a routine expansion into Scheme, but the expansion
is much larger than the concise specification. If the LOAD routine is
required to use READ, I could contemplate something like:
(define (myload file)
(let ((standard-read read))
(set! read myread)
(load file)
(set! read standard-read)))
where myread does the translation before the interpreter gets a hold
of things. We can argue about whether or not this is a good idea, but
I think that the standard should make it clear whether this usage can
be relied on or not.
Similarly READ/(READ-CHAR,PEEK-CHAR). Consider the problem of
internationalizatoin. It would be nice if I could re-implement
READ-CHAR on top of READ-BYTE to do, for example, Kanji characters.
More generally, there are several standard functions which are
logically implemented on top of more-primitive standard functions, but
the standard does not require any necessary relationship between them.
Should it? I could argue this either way, and in a few cases, notably
READ and LOAD, I think it is highly desirable.
I would be interested in hearing other opinions.
Jon