~ chicken-core (chicken-5) bce0d16a76588f8918ace633313edd62ffe575e6
commit bce0d16a76588f8918ace633313edd62ffe575e6 Author: unknown <felix@.(none)> AuthorDate: Mon Oct 19 14:21:51 2009 +0200 Commit: unknown <felix@.(none)> CommitDate: Mon Oct 19 14:21:51 2009 +0200 possible fix for reexport bug; no timing output for benchmarks in test suite diff --git a/TODO b/TODO index 04937a64..11328953 100644 --- a/TODO +++ b/TODO @@ -46,9 +46,14 @@ TODO for chicken -*- Outline -*- * tasks +** remove TODO from master + +** collect list of private commits that haven't been pushed to pending, yet + +** SHA-1 commit-ID in banner + ** branches *** unfucked-dload can be removed -*** remove TODO from master ** module issues *** need a way to omit generating module registration without generating import lib @@ -136,3 +141,4 @@ TODO for chicken -*- Outline -*- (decompose-lambda-list) will be more expensive and cumbersome. ** The benchmarks are meaningless - find real ones. +*** check Feeley's benchmarks (slatex, compiler) diff --git a/expand.scm b/expand.scm index 1e8b0b51..58eefaea 100644 --- a/expand.scm +++ b/expand.scm @@ -879,15 +879,19 @@ (lambda (spec) (let* ((vs (import-spec spec)) (vsv (car vs)) - (vss (cdr vs))) + (vss (cdr vs)) + (prims '())) (dd `(IMPORT: ,loc)) (dd `(V: ,(if cm (module-name cm) '<toplevel>) ,(map-se vsv))) (dd `(S: ,(if cm (module-name cm) '<toplevel>) ,(map-se vss))) (##sys#mark-imported-symbols vsv) ; mark imports as ##core#aliased (for-each (lambda (imp) - (let ((id (car imp)) - (aid (cdr imp))) + (let* ((id (car imp)) + (aid (cdr imp)) + (prim (##sys#get aid '##core#primitive))) + (when prim + (set! prims (cons imp prims))) (and-let* ((a (assq id (import-env))) ((not (eq? aid (cdr a))))) (##sys#warn "re-importing already imported identifier" id)))) @@ -907,12 +911,23 @@ (module-export-list cm) (map car vsv) (map car vss))) + (when (pair? prims) + (set-module-meta-expressions! + cm + (append + (module-meta-expressions cm) + `((##sys#mark-primitive ',prims))))) (dm "export-list: " (module-export-list cm))) (import-env (append vsv (import-env))) (macro-env (append vss (macro-env))))) (cdr x)) '(##core#undefined)))) +(define (##sys#mark-primitive prims) + (for-each + (lambda (a) (##sys#put! (cdr a) '##core#primitive (car a))) + prims)) + (##sys#extend-macro-environment 'import '() (##sys#er-transformer diff --git a/tests/reexport-m1.scm b/tests/reexport-m1.scm new file mode 100644 index 00000000..2358ef47 --- /dev/null +++ b/tests/reexport-m1.scm @@ -0,0 +1,4 @@ +(module reexport-m1 () + (import scheme chicken) + (require-library srfi-1) + (reexport (only srfi-1 cons*))) diff --git a/tests/reexport-m2.scm b/tests/reexport-m2.scm new file mode 100644 index 00000000..ec955f39 --- /dev/null +++ b/tests/reexport-m2.scm @@ -0,0 +1,4 @@ +(module foo () + (import scheme chicken) + (use reexport-m1) + (print (cons* 1 2 3))) diff --git a/tests/runtests.sh b/tests/runtests.sh index e260339e..d53c1b91 100644 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -80,14 +80,20 @@ $compile syntax-tests-2.scm #echo "======================================== meta-syntax tests ..." #$interpret -bnq meta-syntax-test.scm -e '(import foo)' -e '(bar 1 2)' -#$compile_s -s meta-syntax-test.scm -j foo -#$compile_s -s foo.import.scm +#$compile_s meta-syntax-test.scm -j foo +#$compile_s foo.import.scm #$interpret -bnq -e '(require-library meta-syntax-test)' -e '(import foo)' -e '(bar 1 2)' echo "======================================== reexport tests ..." $interpret -bnq reexport-tests.scm $compile reexport-tests.scm ./a.out +rm -f reexport-m*.import* +$compile_s reexport-m1.scm -J +$compile_s reexport-m1.import.scm +$interpret -s reexport-m2.scm +$compile reexport-m2.scm +./a.out echo "======================================== compiler syntax tests ..." $compile compiler-syntax-tests.scm @@ -97,7 +103,7 @@ echo "======================================== import library tests ..." rm -f foo.import.* $compile import-library-test1.scm -emit-import-library foo $interpret -s import-library-test2.scm -$compile_s -s foo.import.scm -o foo.import.so +$compile_s foo.import.scm -o foo.import.so $interpret -s import-library-test2.scm $compile import-library-test2.scm ./a.out @@ -215,7 +221,7 @@ for x in `ls *.scm`; do "plists.scm");; *) echo $x - ../csc $x -compiler $CHICKEN -I.. -L.. -O3 -d0 + ../csc $x -compiler $CHICKEN -I.. -L.. -O3 -d0 -prelude '(define-syntax time (syntax-rules () ((_ x) x)))' ./`basename $x .scm`;; esac doneTrap