Re: define-library-alias Marc Nieper-Wißkirchen 21 Sep 2020 06:13 UTC

Am Do., 4. Juni 2020 um 17:37 Uhr schrieb Marc Feeley <xxxxxx@iro.umontreal.ca>:
>
> I’m late to the conversation, but how about simply “extends” :
>
>  (define-library (scheme list)
>    (extends (srfi 1))

I think there is a fundamental difference between `(alias-for (srfi
1))` and `(extends (srfi 1))`. In the former case, we just have one
library with two names. In particular, the library only has to be
loaded (and expanded) once. In the latter case, we have to libraries
(which just may happen to be equivalent) that have to be loaded and
expanded separately. So it even makes sense to have both forms
separately. The `extends` form would expand into an import declaration
together with a corresponding export declaration. It makes sense to
allow that the `extends` form is decorated with `only`, `prefix`,
`rename`, and `except`.

For the "magic" library `(srfi 206 *)` from SRFI 206 (currently called
`(auto)` in Chibi), the `alias-for` form should work, while the
`extends` form would not.

Marc

PS I very much prefer Alex's original version `(define-library-alias
...)` because the `(define-library (...) (alias-for ...))` version is
inelegant: It is more complicated because of the existence of
`include-library-declarations` (which could include an `alias-for`),
and it is logically not satisfactory because `alias-for` is not on par
with any of the other library declarations, but it really changes the
meaning of the top-level library definition.