chicken recursive library import pasted by sethalves on Fri Jul 26 21:29:10 2013

#! /bin/sh
#| -*- scheme -*-
exec csi -s $0 "$@"
|#

(use r7rs)
(import-for-syntax r7rs)

(define-library (hi fuh)
  (export buh)
  ;; (cond-expand (chicken (import (srfi-4))))
  (import (srfi-4))
  (begin
    (define (buh) (u8vector 1 2 3))))


(define-library (ok ekk)
  (export buhbuh)
  (import (hi fuh))
  (begin
    (define (buhbuh) (buh))))


(import (ok ekk))
(display (buhbuh))
(newline)

works with register-feature! pasted by sethalves on Fri Jul 26 22:40:45 2013

#! /bin/sh
#| -*- scheme -*-
exec csi -s $0 "$@"
|#

(use r7rs)
(import-for-syntax r7rs)

(define-library (hi fuh)
  (export buh)
  (import (chicken) (srfi-4) (feature-test))
  (begin
    (define (buh) (u8vector 1 2 3))
    (register-feature! 'hi.fuh)))

(define-library (ok ekk)
  (export buhbuh)
  (import (hi fuh))
  (begin
    (define (buhbuh) (buh))))


(import (ok ekk))
(display (buhbuh))
(newline)

register-feature! patch added by sethalves on Fri Jul 26 22:49:10 2013

Index: r7rs-compile-time.scm
===================================================================
--- r7rs-compile-time.scm       (revision 29420)
+++ r7rs-compile-time.scm       (working copy)
@@ -95,7 +95,7 @@
         ;; What R7RS calls IMPORT, we call USE (it imports *and* loads code)
          ;; XXX TODO: Should be import-for-syntax'ed as well?
         `(##core#require-extension
-          ,(map (lambda (s) (fixup-import/export-spec s 'import)) specs)
+          ,(map (lambda (s) (fixup-import/export-spec s 'import)) (cons '(chicken) specs))
           #t))
        (define (process-includes fnames ci?)
         `(##core#begin
@@ -135,7 +135,7 @@
              ,(parse-decls more)))
           ((('begin code ...) . more)
            `(##core#begin
-             (##core#begin ,@code)
+             (##core#begin ,@code (register-feature! ',real-name))
              ,(parse-decls more)))
           (decl (syntax-error 'define-library "invalid library declaration" decl))))
        `(##core#module ,real-name ((,dummy-export))