lang/reader.ss
(module reader syntax/module-reader
  #:language 'scheme
  #:read (lambda ([in (current-input-port)])
           (the-read (curry read-syntax #f) in))
  #:read-syntax (lambda ([source-name #f] [in (current-input-port)])
                  (the-read (curry read-syntax source-name)
                            in))
  #:whole-body-readers? #t
  (require (planet cce/scheme:4:1/planet)
           scheme/port
           scheme/list
           scheme/function
           "../parse.ss")
  
  (define (read-all read ip)
    (define c (read ip))
    (if (eof-object? c)
        empty
        (cons c (read-all read ip))))
  
  (define (the-read read ip)
    (define-values (si ci) (split-port ip))
    
    (list* 
     '(require scheme/foreign)
     '(unsafe!)
     `(require (planet ,(this-package-version-symbol c-loader)))
     `(c-loader ,(port->string ci))
     (read-all read si))))