Michael Montague writes:
R6RS libraries without versions and import levels seem awfully close to R7RS libraries; could they be made closer to the same without losing the benefits of R7RS libraries? For example, assuming #535, I believe that the following would be a valid R6RS and R7RS library (ignoring library vs define-library keyword).(library (stack) (export make push! pop! empty!) (import (rnrs)) (begin ;;; <----- all I did was add this to the example in section 7.3 of R6RS (define (make) (list '())) (define (push! s v) (set-car! s (cons v (car s)))) (define (pop! s) (let ([v (caar s)]) (set-car! s (cdar s)) v)) (define (empty! s) (set-car! s '()))))
This is a valid transformation even without #535, at least for an implementation that provides the (rnrs) library. The effect of #535 is to forbid multiple begin declarations; the existing draft already permits single ones.
The primary benefit of using a distinct keyword is to allow R6RS implementations to immediately reject R7RS libraries that they cannot process. R7RS implementations that don't provide the R6RS system libraries (such as Chibi) can also reject R6RS user libraries easily, but of course there is nothing to prevent R7RS implementations from accepting R6RS libraries as well, as Sagittarius does.