change the way that hidden package ids are generated

svn: r14277
This commit is contained in:
Matthew Flatt 2009-03-25 16:51:13 +00:00
parent 004eb4ca6d
commit 4ce30226fe

View File

@ -71,6 +71,10 @@
"misuse of a package name" "misuse of a package name"
stx))) stx)))
(define (generate-hidden id)
;; Like `generate-temporaries', but preserve the symbolic name
((make-syntax-introducer) (datum->syntax #f (syntax-e id))))
(define (reverse-mapping who id exports hidden) (define (reverse-mapping who id exports hidden)
(or (ormap (lambda (m) (or (ormap (lambda (m)
(and (free-identifier=? id (cdr m)) (and (free-identifier=? id (cdr m))
@ -85,7 +89,7 @@
;; avoid potential duplicate-definition errors ;; avoid potential duplicate-definition errors
;; when the name is bound in the same context as ;; when the name is bound in the same context as
;; the package. ;; the package.
(car (generate-temporaries (list id))))) (generate-hidden id)))
hidden) hidden)
id))) id)))
@ -172,7 +176,7 @@
;; It's not accessible, so just hide the name ;; It's not accessible, so just hide the name
;; to avoid re-binding errors. (Is this necessary, ;; to avoid re-binding errors. (Is this necessary,
;; or would `pre-package-id' take care of it?) ;; or would `pre-package-id' take care of it?)
(car (generate-temporaries (list id))))) (generate-hidden id)))
(syntax->list #'(export ...)))]) (syntax->list #'(export ...)))])
(syntax/loc stx (syntax/loc stx
(define-syntaxes (pack-id) (define-syntaxes (pack-id)