[gambit-list] Scheme library namespace and library name mapping
Lassi Kortela
lassi at lassi.io
Mon Apr 27 12:03:18 EDT 2020
> I agree it is a good idea to have some management of namespaces. I am
> not so convinced about the use of URLs for that purpose. (Apart from
> aesthetics, will `https://www.nieper-wisskirchen.de' and
> `http://www.nieper-wisskirchen.de' be different URLs for that
> purpose?)
>
> If the library names become long (like with URIs), it would be nice
> each Scheme system allows to use or install a mapper (a simple
> association) from long names to short names so that I can access
> libraries as `(nieper foo)' instead of
> `(|https://www.nieper-wisskirchen.de| foo)'. If we go this route, we
> can drop URLs altogether and replace them with UUIDs, which everyone
> can generate (version 4 UUIDs). In fact, they are shorter than most
> URLs and no less pretty in library names.
A standard way to rewrite library names (in the same way that individual
identifiers exported from libraries can be renamed in R7RS) would be useful.
Re: URIs and UUIDs, we just worked out this problem a few weeks ago with
John in a different context: <https://github.com/unisig/unisig>. Our
solution was to use either UUIDs, or URIs of the form
"example.com/myname#fragment". I'd recommend that same form for Scheme
libraries as well. Maybe drop the fragment part; we should think about
it some more.
Gambit is tentatively using "@v" as the last part of the library name
for versioning, where "v" is a Git ref (tag or commit).
>> I wonder if it's better to recommend that all URLs be enclosed in vertical bars, which is safe and simple as vertical bars are not valid in URLs unless %-escaped, or to specify that only URLs containing characters from "#[]'(),;" be enclosed, which minimizes the use of vertical bars.
>
> Many R7RS systems don't define the mapping from library names to file
> names for library names that include characters like the slash or the
> dot. There may be other limitations.
It might make sense to have a convention to treat any library name with
a dot as a URI by default. With the possibility for each user to
manually add their own rewrite rules to override that default where needed.
More information about the Gambit-list
mailing list