Thanks Alex.  That makes sense.
I reckon, if it is to be portable, it shouldn't be a normal Scheme syntax but the meta-level syntax (the same level as define-library),  Correct?  (Of course an implementation can implement it as a syntax.  But the effect of using it in <command or definition> ... is undefined).


On Tue, May 26, 2020 at 2:35 PM Alex Shinn <xxxxxx@gmail.com> wrote:
Hi Shiro,

I was aware of the Gauche extend syntax and considered it as another extension to define-library.

However, the cons you mention swayed me.  I didn't want the added flexibility or
discussions about resulting semantics.  What if you alias multiple libraries? What
if you alias and then add some definitions?

Also, this is more lightweight - there is only one library object, which can be referred
to by either name in the library registry.

--
Alex

On Wed, May 27, 2020 at 9:08 AM Shiro Kawai <xxxxxx@gmail.com> wrote:
I'm for the general idea; In Gauche, you can say (define-module scheme.bitwise (extend srfi.151)) and indeed we have tons of libraries like it.
There may be options for the syntax, though.

Having dedicated syntax like define-library-alias has the advantage that each implementation can expand it to whatever forms that suits it.  But I'm wary about yet-another top-level special syntax.  And if it is allowed to expand into define-library form, where you can write it is limited, but it isn't obvious.

Another option is to extend define-library syntax, e.g. (define-library (alias <library-name>)).  This can also be interpreted as "import the named library and re-export all exported identifiers" (the name is debatable), and if so, you can add more definitions there to enhance the original library.  Pros are that (1) it is clear that it's define-library level meta-syntax and not an ordinary macro, and (2) in the latter form, you can put additional definitions.   Cons: it might be too flexible---too easy to write many libraries that adds little something to existing libraries, like what happened in the inheritance of OOP, 




On Tue, May 26, 2020 at 3:34 AM Lassi Kortela <xxxxxx@lassi.io> wrote:
Alex just added this simple feature to Chibi:

(define-library-alias (scheme bitwise) (srfi 151))

Probably of interest to other Scheme implementations as well, especially
as R7RS-large re-exports a lot of SRFIs.

Diff at
<https://github.com/ashinn/chibi-scheme/commit/9901a67b202b649ce5037b3e2263bed4ff74c72f>.