On Sat, 2010-01-16 at 01:00 -0600, Eduardo Cavazos wrote: > On Fri, 2010-01-15 at 23:57 -0600, Eduardo Cavazos wrote: > > > On Fri, 2010-01-15 at 21:36 -0800, Derick Eddington wrote: > > > > > Actually, it's illegal, if there are definitions after it, because > > > expressions cannot precede definitions in a library body. > > > > 8-) > > > > Hmmm... Well maybe something like: > > > > (define library-info '((author . "...") > > (summary . "..."))) > > I think the "right thing" is: > > (library (xyz) > > (export xyz) > > (import (rnrs)) > > (author "...") > > (summary "...") > > (license "...") > > ...) > > Unforunately, that's not an option unless the implementation supports > those extensions to the 'library' form.
I dislike it because it's rigid. All such forms would always have to occur, to avoid ambiguity with identical-appearing forms which are supposed to be part of the library body. What if a form is desired to be omitted? What if a new form is desired? Not possible. Also, it's not portable unless all systems support it. > Another option: > > (library (xyz) > > (export xyz) > > (import (rnrs) (library-annotation)) > > (author "...") > > (summary "...") > > (license "...") > > ...) > > But the drawback is that you'll always need to import that extra library > for the 'author', 'summary', etc. I don't like that either. > Finally, there's: > > (define library-info > '((author . "...") > (summary . "..."))) > > Which doesn't require additional imports, but also doesn't look as nice > as the first two options. I don't like that either. > Are there implementations that give users control over how the library > form is expanded? I think PLT might, by using a "module language" other than #!r6rs and made for it. But that's not portable. The library form exists outside everything intentionally, so that its meaning can be independent. > Anywho, other solutions would get into putting the data inside comments > or in external files. The data could be put after the library form. Precise file-name extensions like .r6rs-lib allow knowing the file format, which would even allow this to work with systems supporting multiple libraries per file, because .r6rs-lib files have only one library as the first form and anything after is ignored by the library loading, and multi-library files should have a different extension. Or, the data could be put in separate files with an appropriate extension, and SRFI 104 can be parameterized to use that extension and then such metadata files can be located based on library names. -- : Derick ----------------------------------------------------------------
