There are some incompatibilities between Guile and the R6RS. Some of them are intentional, some of them are bugs, and some are simply unimplemented features. Please let the Guile developers know if you find one that is not on this list.
library forms in one file are not yet supported. This
is because the expansion of library sets the current module, but
does not restore it. This is a bug.
set! to a variable transformer may only expand to an
expression, not a definition—even if the original set!
expression was in definition context.
For example, while the expansion of the following set of recursive nested definitions does do the correct thing:
(let ()
(define even?
(lambda (x)
(or (= x 0) (odd? (- x 1)))))
(define-syntax odd?
(syntax-rules ()
((odd? x) (not (even? x)))))
(even? 10))
⇒ #t
The same definitions at the toplevel do not:
(begin
(define even?
(lambda (x)
(or (= x 0) (odd? (- x 1)))))
(define-syntax odd?
(syntax-rules ()
((odd? x) (not (even? x)))))
(even? 10))
<unnamed port>:4:18: In procedure even?:
<unnamed port>:4:18: Wrong type to apply: #<syntax-transformer odd?>
This is because when expanding the right-hand-side of even?, the
reference to odd? is not yet marked as a syntax transformer, so
it is assumed to be a function.
While it is likely that we can fix the case of toplevel forms nested in
a begin or a library form, a fix for toplevel programs
seems trickier to implement in a backward-compatible way. Suggestions
and/or patches would be appreciated.
(rnrs io ports) module is mostly unimplemented. Work is
ongoing to fix this.