[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Requested changes to R4RS
Since we seem to have boiled this down to a concrete issue, I have
As for your question about LOAD, there is *no* procedure in the report
whose meaning is defined in terms of the binding of any variable in
the initial environment. Thus the CADR procedure is not sensitive to
the bindings of the variables CAR or CDR, and the LOAD procedure is
not sensitive to the bindings of OPEN-INPUT-FILE or READ.
I don't recall any wording in the standard that says one way or the
other whether things like CADR depend on things like CAR. Maybe I
just missed it. If it isn't there, I feel that it should be made
explicit. As a programmer, I should be entitled to know whether
rebinding READ has an impact on LOAD, etc.
I believe that the right solution is for all of these things to be
independent. Rebinding one standard function should have no impact on
the behavior of any other. I would be interested in other opinions.
Note, however, that this would preclude an implementation from
implementing CADR in Scheme in the obvious way:
(define (CADR lis) (car (cdr lis)))
It instead would have to be:
(define (CADR lis)
(let ((car `,car)
(car (cdr lis))))
Making things independent means that I can change things portably.
Users who wish to have things interact are free to re-implement CADR
in terms of CAR and CDR, and similarly for other standard functions.