split reqprov.ss to require.ss and provide.ss

svn: r8952
This commit is contained in:
Eli Barzilay 2008-03-11 21:12:10 +00:00
parent 9c0df7fc7c
commit c3e9f14441
5 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1,15 @@
#lang scheme/base
(require (for-syntax scheme/base scheme/provide-transform))
(provide matching-identifiers-out)
(define-syntax matching-identifiers-out
(make-provide-transformer
(lambda (stx modes)
(syntax-case stx ()
[(_ rx spec)
(regexp? (syntax-e #'rx))
(let ([rx (syntax-e #'rx)])
(filter (lambda (e)
(regexp-match? rx (symbol->string (export-out-sym e))))
(expand-export #'spec modes)))]))))

View File

@ -9,8 +9,8 @@
(syntax-case stx ()
[(_ rx spec)
(regexp? (syntax-e #'rx))
(let*-values ([(rx) (syntax-e #'rx)]
[(imports sources) (expand-import #'spec)])
(let-values ([(rx) (syntax-e #'rx)]
[(imports sources) (expand-import #'spec)])
(values
(filter (lambda (i)
(regexp-match? rx (symbol->string

View File

@ -1341,7 +1341,7 @@ pre-defined forms are as follows.
error is reported.}
@defsubform[(except-in require-spec id ...)]{ Like
@scheme[require-spec], but omitting those exports for which
@scheme[require-spec], but omitting those imports for which
@scheme[id]s are the identifiers to bind; if any @scheme[id] is not
in the set that @scheme[require-spec] describes, a syntax error is
reported.}
@ -1715,9 +1715,9 @@ introduced at the same time. Similarly, @schemeidfont{all-defined} and
its variants export only definitions accessible from the lexical
context of the @scheme[phaseless-spec] form.}
@subsection{Additional @scheme[require] and @scheme[provide] Macros}
@subsection{Additional @scheme[require] Macros}
@note-lib-only[scheme/reqprov]
@note-lib-only[scheme/require]
This library provides additional forms for use in @scheme[require] and
@scheme[provide]. These forms provide more complex selection and
@ -1726,22 +1726,34 @@ massaging of identifiers that are useful in some cases. Note that a
requiring the library itself should be a separate form. For example, use
@schemeblock[
(require scheme/reqprov)
(require scheme/require)
(require (matching-identifiers-in #rx"foo" "foo.ss"))
]
instead of
@schemeblock[
(require scheme/reqprov
(require scheme/require
(matching-identifiers-in #rx"foo" "foo.ss"))
]
@defsubform[(matching-identifiers-in regexp require-spec)]{
Like @scheme[require-spec], but including only exports whose names
Like @scheme[require-spec], but including only imports whose names
match @scheme[regexp]. @scheme[regexp] must be a literal regular
expression (see @secref["regexp"]).}
@subsection{Additional @scheme[provide] Macros}
@note-lib-only[scheme/provide]
This library provides additional forms for use in @scheme[provide], it
mirrors the @scheme[scheme/require] library.
@defsubform[(matching-identifiers-out regexp provide-spec)]{
Like @scheme[provide-spec], but omitting the export of each binding
with an external name that matches @scheme[regexp]. @scheme[regexp]
must be a literal regular expression (see @secref["regexp"]).}
@;------------------------------------------------------------------------
@section[#:tag "#%top-interaction"]{Interaction Wrapper: @scheme[#%top-interaction]}

View File

@ -1,6 +1,6 @@
#lang scheme/base
(require scheme/reqprov)
(require scheme/require)
;; Note: this also gets additional functions for srfi-66 (u8vector-copy,
;; u8vector=?, u8vector-compare, u8vector-copy!) -- but that should be fine,

View File

@ -1,5 +1,5 @@
#lang scheme/base
(require scheme/reqprov)
(require scheme/require)
(require (matching-identifiers-in #px"\\bu8vector\\b" scheme/foreign))
(provide (all-from-out scheme/foreign))