I think a standard interface for resolvers (i.e. specifying where to find the library forms that define the libraries you want to import) would make for a useful SRFI.
We can make a list of possible resolvers, if that would be helpful: - in a directory "/some/path": look for files /some/path/library-name.ext with one library in each file. maybe can choose the extension, and some function on the filename. - in a file "/some/path/to/file.ext": look for library definitions within the file - both of the above could use urls as well as filesystem paths - in a database Would there be any problems with trying to standardize an interface for this kind of thing? On Thu, May 14, 2009 at 9:24 AM, Eduardo Cavazos <[email protected]> wrote: > Hello, > > Many Scheme implementations offer a way to specify a list of locations to > search for libraries. I think the rule for resolving a library to its source > should be configurable on a per location basis. So for example you might > tell the system that you have libraries in some directories: > > (set-library-locations "/usr/local/scheme-libraries" > "/home/chupacabra/scheme-libraries") > > In this case, the implementation would use the default resolver that maps as > follows: > > (a b c) => "a/b/c.sls" > > I prefer resolvers that work like this: > > (a b c) => "a/b/c/c.sls" > > And the R6RS authors think you might want to access the source from a > database! > > So it would be nice if you could specify the resolver: > > (set-library-locations > (standard-resolver "/usr/local/scheme-libraries") > (my-resolver "/home/chupacabra/scheme-libraries" > (database-resolver "/home/chupacabra/database")) > > You could do stuff like this: > > (http-resolver "http://crop-circles.info/libraries") > > and the implementation would treat the remote list of files as a source of > libraries, downloading them as necessary. > > Ed >
