The R6RS `library' form requires the (export ...) list to appear before the (import ...) list. I'm not sure if this itself is a bug; R6RS consistently uses that order, doesn't mention the order to be irrelevant, and seems to me to imply that it's indeed mandatory. I didn't check for what other R6RS implementations do though. Here's a corresponding documentation patch against master/3be43fb: