[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] searching for libraries



Per Bothner scripsit:

> 5.5.1 Library Syntax says:
>
> "Note: Implementations are encouraged to search for files in the
> directory which contains the including file, and to provide a way for
> users to specify other directories to search."
>
> What does this mean?  This implies a mapping from library to file,
> which I don't see otherwise specified.

Note the second paragraph of 5.1:

        Programs and libraries are typically stored in files, although
        programs can be entered interactively to a running Scheme
        system, and other paradigms are possible. Implementations which
        store libraries in files should document the mapping from the
        name of a library to its location in the file system.

> Can there be multiple libraries in a source file?  That might make for
> easier interchange/distribution, but it makes searching difficult,
> unless a collection of libraries are pre-processed (or compiled) into
> a data-base or index.  Which is certainly a possible model.

Quite so.  This is why we keep the mapping undefined in the standard but
encourage an implementation-specified mapping.

> (1) A "library interchange file" is the concatenation of one or
> more libraries.  An installation provides a command to install
> one or more interchange files into a repository, where repository
> has some location (typically a directory).  When a program
> (top-level) is evaluated, it search one or more repositories, in
> some implementation-dependent way.  Note this model assumes some
> installation step, which can be combined with compilation.

The Snow package file serves this purpose.  Each implementation can
provide its own Snow client that installs the package files in the
appropriate places, breaking them up if necessary.

> (2) A library file contains a single library.  A library named (A1
> A2 AN) is in a file named "A1/A2/AN.scm" (or some other standardized
> file extension), relative to some "library root" (repository).  For
> portability, library component names should be integers or lower-case
> identifiers that avoid certain prohibited characters.  When a library
> or top-level imports some other library, the corresponding file is
> found in the obvious way. This model does not require indexing or
> compilation, though it does not preclude either.

Ticket filed to document this non-normatively.

Ticket filed to set non-normative limits on the characters in library
identifiers.

-- 
John Cowan  cowan@x   http://ccil.org/~cowan
"The exception proves the rule."  Dimbulbs think: "Your counterexample proves
my theory."  Latin students think "'Probat' means 'tests': the exception puts
the rule to the proof."  But legal historians know it means "Evidence for an
exception is evidence of the existence of a rule in cases not excepted from."

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports