diff --git a/scheme/ikarus.boot.orig b/scheme/ikarus.boot.orig index 7e527bf..20612fd 100644 Binary files a/scheme/ikarus.boot.orig and b/scheme/ikarus.boot.orig differ diff --git a/scheme/makefile.ss b/scheme/makefile.ss index e125355..85d8074 100755 --- a/scheme/makefile.ss +++ b/scheme/makefile.ss @@ -14,14 +14,14 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . - -(import (except (ikarus) assembler-output) - (ikarus compiler) - (except (psyntax system $bootstrap) +(import (only (ikarus) import)) +(import (except (ikarus) assembler-output)) +(import (ikarus compiler)) +(import (except (psyntax system $bootstrap) eval-core current-primitive-locations compile-core-expr-to-port)) - +(import (ikarus compiler)) ; just for fun (define scheme-library-files ;;; Listed in the order in which they're loaded. diff --git a/scheme/psyntax.expander.ss b/scheme/psyntax.expander.ss index 6d57d98..52ae664 100644 --- a/scheme/psyntax.expander.ss +++ b/scheme/psyntax.expander.ss @@ -108,23 +108,29 @@ ;;; # (define (extend-rib! rib id label) - (define (find sym mark* sym* mark**) + (define (find sym mark* sym* mark** label*) (and (pair? sym*) - (or (and (eq? sym (car sym*)) - (same-marks? mark* (car mark**))) - (find sym mark* (cdr sym*) (cdr mark**))))) + (if (and (eq? sym (car sym*)) (same-marks? mark* (car mark**))) + (car label*) + (find sym mark* (cdr sym*) (cdr mark**) (cdr label*))))) (when (rib-sealed/freq rib) (error 'extend-rib! "rib is sealed" rib)) - (let ((sym (id->sym id)) (mark* (stx-mark* id))) + (let ((sym (id->sym id)) + (mark* (stx-mark* id))) (let ((sym* (rib-sym* rib))) - (when (and (memq sym (rib-sym* rib)) - (find sym mark* sym* (rib-mark** rib))) - ;;; signal an error if the identifier was already - ;;; in the rib. - (stx-error id "cannot redefine")) - (set-rib-sym*! rib (cons sym sym*)) - (set-rib-mark**! rib (cons mark* (rib-mark** rib))) - (set-rib-label*! rib (cons label (rib-label* rib)))))) + (cond + [(and (memq sym (rib-sym* rib)) + (find sym mark* sym* (rib-mark** rib) (rib-label* rib))) + => + (lambda (label^) + (unless (eq? label label^) + ;;; signal an error if the identifier was already + ;;; in the rib. + (stx-error id "cannot redefine")))] + [else + (set-rib-sym*! rib (cons sym sym*)) + (set-rib-mark**! rib (cons mark* (rib-mark** rib))) + (set-rib-label*! rib (cons label (rib-label* rib)))])))) ;;; A rib can be sealed once all bindings are inserted. To seal ;;; a rib, we convert the lists sym*, mark**, and label* to vectors @@ -2629,7 +2635,8 @@ (let ([name (car x)]) (datum->stx ctxt name))) subst) - (map cdr subst)))])) + (map cdr subst)))] + [_ (stx-error e "invalid import form")])) (let-values (((id* lab*) (if (module-import? e) (module-import e r)