On Mon, Nov 11, 2013 at 2:02 PM, John Cowan <xxxxxx@mercury.ccil.org> wrote:
Alex Shinn scripsit:

> You didn't give any justification for this conclusion.
> What's wrong with providing features?

For one thing, there is no way to do it.  If I write a portable
implementation that supports backreferences, how do I cause the existence,
or even the importation, of that package to assert the regexp-backrefs
feature?  After all, I might have several different implementations
lying about.

That was the only argument that crossed my mind,
but the general case is that this is an implementation-
provided library in (scheme regexp), and using your
own implementation will be the uncommon case.

But more generally, library features are something
people are likely to want in the large language, and
it's worth considering allowing them with a "provides"
decl in define-library.  However, to best use in
conjunction with library-decl-level cond-expand we'd
want to be able to conditionally expand on these.

For example, currently you test library availability
with:

(define-library (foo bar)
  ...
  (cond-expand
   ((library (scheme regexp))
    ...)
   (else
    ...)))

but you might want:

(define-library (foo bar)
  ...
  (cond-expand
   ((library-provides (scheme regexp) regexp-unicode)
    ...)
   (else
    ...)))

It is perhaps too soon to standardize this, but I know
we're already entertaining new library decls in the large
language.

-- 
Alex