(library (rnrs (6))         
    ;; Macros defined in core expander:
    begin if lambda quote set! and or
    define define-syntax let-syntax letrec-syntax
    _ ...
    ;; Derived syntax:
    let let* letrec letrec* let-values let*-values
    case cond else =>
    quasiquote unquote unquote-splicing
    syntax-rules identifier-syntax

    ;; R5RS primitives:
    * + - / < <= = > >= abs acos append apply asin atan 
    boolean? call-with-current-continuation 
    call-with-values car cdr caar cadr cdar cddr
    caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar
    cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
    ceiling char? char->integer
    complex? cons cos 
    denominator dynamic-wind 
    eq? equal? eqv? even? exact? exp expt floor for-each
    gcd imag-part inexact? integer->char integer?
    lcm length list list->string
    list->vector list-ref list-tail list? log magnitude make-polar
    make-rectangular make-string make-vector map max min
    negative? not null? number->string number? numerator
    odd? pair? 
    positive? procedure? rational? rationalize
    real-part real? reverse round
    sin sqrt string string->list string->number string->symbol
    string-copy string-length string-ref string<=? string<?
    string=? string>=? string>? string? substring symbol->string symbol? tan
    truncate values vector vector->list
    vector-fill! vector-length vector-ref vector-set! vector? zero?    

    ;; R6RS additional procedures:
    real-valued? rational-valued? integer-valued? exact inexact finite? infinite?
    nan? div mod div-and-mod div0 mod0 div0-and-mod0 exact-integer-sqrt boolean=?
    symbol=? string-for-each vector-map vector-for-each error assertion-violation

    char=? char<? char>? char<=? char>=?

    ;; From (rnrs unicode)
    char-upcase char-downcase char-titlecase char-foldcase	
    char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=? 
    char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case? 
    string-upcase string-downcase string-titlecase string-foldcase
    string-ci=? string-ci<? string-ci>? string-ci<=? string-ci>=?
    string-normalize-nfd string-normalize-nfkd string-normalize-nfc string-normalize-nfkc

    ;; From (rnrs bytevectors)

    endianness native-endianness
    bytevector? make-bytevector bytevector-length
    bytevector-u8-ref bytevector-s8-ref
    bytevector-u8-set! bytevector-s8-set!
    bytevector-uint-ref bytevector-sint-ref
    bytevector-uint-set! bytevector-sint-set!
    bytevector-u16-ref bytevector-s16-ref
    bytevector-u16-set! bytevector-s16-set!
    bytevector-u16-native-ref bytevector-s16-native-ref
    bytevector-u16-native-set! bytevector-s16-native-set!
    bytevector-u32-ref bytevector-s32-ref
    bytevector-u32-set! bytevector-s32-set!
    bytevector-u32-native-ref bytevector-s32-native-ref
    bytevector-u32-native-set! bytevector-s32-native-set!
    bytevector-u64-ref bytevector-s64-ref
    bytevector-u64-set! bytevector-s64-set!
    bytevector-u64-native-ref bytevector-s64-native-ref
    bytevector-u64-native-set! bytevector-s64-native-set!
    bytevector-ieee-single-native-ref bytevector-ieee-single-ref
    bytevector-ieee-double-native-ref bytevector-ieee-double-ref
    bytevector-ieee-single-native-set! bytevector-ieee-single-set!
    bytevector-ieee-double-native-set! bytevector-ieee-double-set!
    bytevector-copy! bytevector-copy
    bytevector->u8-list u8-list->bytevector
    bytevector->uint-list bytevector->sint-list
    uint-list->bytevector sint-list->bytevector
    utf8->string utf16->string utf32->string
    string->utf8 string->utf16 string->utf32
    ;; From (rnrs records syntactic)

    define-record-type record-type-descriptor record-constructor-descriptor
    fields mutable immutable parent protocol sealed opaque nongenerative

    ;; I don't know why this breaks.

    ;; From (rnrs records procedural)

    make-record-type-descriptor record-type-descriptor?
    make-record-constructor-descriptor record-constructor
    record-predicate record-accessor record-mutator
    ;; From (rnrs records inspection)

    record-type-name record-type-parent record-type-sealed?
    record-type-uid record-type-generative? record-type-field-names
    record-type-opaque? record-field-mutable? record? record-rtd

    ;; From (rnrs control)
    when unless do case-lambda
    ;; From (rnrs lists)
    find for-all exists filter partition fold-left fold-right
    remp remove remq remv memp assp
    memv member memq assoc assv assq
    ;; From (rnrs io simple)
    call-with-input-file call-with-output-file 
    close-input-port close-output-port current-input-port current-output-port
    display eof-object? newline open-input-file open-output-file peek-char
    read read-char with-input-from-file with-output-to-file write write-char   

    ;; syntax-case
    identifier? bound-identifier=? free-identifier=?
    generate-temporaries datum->syntax syntax->datum 
    syntax-violation syntax syntax-case quasisyntax 
    unsyntax unsyntax-splicing with-syntax 

    ;; hash-tables
    ;; enumerations

   (import (for (except (rnrs base) syntax-rules identifier-syntax _ ... set!) run expand)
           (for (only (rnrs base) set!)                                        run expand)
	   (for (only (rnrs base) syntax-rules identifier-syntax)              run expand)        
           (for (rnrs unicode)                                                 run expand)
           (for (rnrs bytevectors)                                             run expand)
           (for (rnrs lists)                                                   run expand)
	;; (for (rnrs sorting)                                                 run expand)  ; Implemented, but in terms of SRFIs...
           (for (rnrs control)                                                 run expand)
	   (for (rnrs records syntactic)                                       run expand)
	   (for (rnrs records procedural)                                      run expand)
	   (for (rnrs records inspection)                                      run expand)
        ;; (for (rnrs exceptions)                                              run expand)  ; Not implemented
	;; (for (rnrs conditions)                                              run expand)  ; Not implemented
        ;; (for (rnrs io ports)                                                run expand)  ; Not implemented
           (for (rnrs io simple)                                               run expand)
	   (for (rnrs files)                                                   run expand)
           (for (rnrs programs)                                                run expand)
        ;; (for (rnrs arithmetic fixnums)                                      run expand)  ; Not implemented
        ;; (for (rnrs arithmetic flonums)                                      run expand)  ; Not implemented
           (for (rnrs arithmetic bitwise)                                      run expand)
           (for (rnrs syntax-case)                                             run expand)
        ;; (for (rnrs hash-tables)                                             run expand)
	;; (for (rnrs enumerations)                                            run expand)
   ) ;; rnrs