Changeset 12495 in project for chicken


Ignore:
Timestamp:
11/14/08 10:28:38 (11 years ago)
Author:
felix winkelmann
Message:

reexport of syntax seems to work now

Location:
chicken/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/TODO

    r12476 r12495  
    2020    workaround is to set them to nil by default)
    2121*** same for ##sys#chicken-ffi-macro-environment
    22 *** re-exports of syntax doesn't work
    23     generating import library requires source
    24     (compiled-module-registration), but original module is lost after
    25     importing. Can we simply pull expander closure out of module from which
    26     we imported?
    2722*** `require-extension' fails in interpreter when extension is .so without import library
    2823    probably because load and import is in same toplevel form, and the
     
    6762**** handle redirects in http-fetch
    6863
    69 ** library
     64** library units
    7065*** read-mark list should be stored in read-table
     66*** ports should have indicator slot about exact type (tcp, file, ...)
    7167
    7268** syntax-error
  • chicken/trunk/expand.scm

    r12436 r12495  
    14321432                 (let* ((name (car sexport))
    14331433                        (a (assq name dlist)))
    1434                    (unless (pair? a)
    1435                      (error 'module "(internal) exported syntax has no source" name mname))
    1436                    `(cons ',(car sexport) ,(cdr a))))
     1434                   (cond ((pair? a)
     1435                          `(cons ',(car sexport) ,(cdr a)))
     1436                         (else
     1437                          (dm "re-exported syntax" name mname)
     1438                          `',name))))
    14371439               sexports))
    14381440       (list
     
    14471449(define (##sys#register-compiled-module name iexports vexports sexports #!optional
    14481450                                        (sdefs '()))
     1451  (define (find-reexport name)
     1452    (let ((a (assq name (##sys#macro-environment))))
     1453      (if (pair? (cdr a))
     1454          a
     1455          (##sys#error
     1456           'import "can not find implementation of re-exported syntax"
     1457           name))))
    14491458  (let* ((sexps
    14501459          (map (lambda (se)
    1451                  (list (car se) #f (##sys#er-transformer (cdr se))))
     1460                 (if (symbol? se)
     1461                     (find-reexport se)
     1462                     (list (car se) #f (##sys#er-transformer (cdr se)))))
    14521463               sexports))
    14531464         (iexps
  • chicken/trunk/manual/Modules and macros

    r12318 r12495  
    485485be one.
    486486
    487 * Reexport of syntactic bindings is currently not supported
    488487* In evaluated code, loading a file containing module information and importing from a module contained in that file will not work when the loading and import is performed in the same toplevel expression (this does not apply, when import libraries are used)
    489488* Currently value bindings imported by {{import}} and {{import-for-syntax}} share the same import-environment.
  • chicken/trunk/tests/import-library-test1.scm

    r12436 r12495  
    1 (module foo (foo)
    2   (import scheme)
     1(module foo (foo xcase)
     2  (import (rename scheme (case xcase)))
    33  (define-syntax foo
    44    (syntax-rules ()
  • chicken/trunk/tests/import-library-test2.scm

    r12436 r12495  
    11(require-library import-library-test1)
    22
    3 (module bar ()
     3(module bar (xcase)
    44  (import scheme chicken extras foo)
    5   (assert (equal? '(123) (foo))))
    6    
     5  (assert (equal? '(123) (foo)))
     6  (assert (= 2 (xcase 1 ((1) 2)))))
     7
     8(import bar)
     9(assert (= 2 (xcase 1 ((1) 2))))
Note: See TracChangeset for help on using the changeset viewer.