On 05/12/2013 09:54 PM, Mikael wrote: > Suggestion: > > Please find a way so that the library body in the library definition > file is at the top level. > > One way would be to allow a variant of |define-library| of 5.6.1. to be > used as (define-library (library name)) > and then provide the (library declaration):s subsequent to this one, > with the exception of the |begin| library > declaration whose contents are inlined by themselves. > > I'd guess many times the Scheme file's filename would provide the > information otherwise provided by > (define-library (library name)) , so that that line could be made > optional generally also.
I was planning on proposing an SRFI for this - after/if R7RS is ratified (and after I finalize at least some of my pending SRFIs). Kawa supports something very similar to what I think you're asking for: http://www.gnu.org/software/kawa/Module-classes.html However, Kawa has its own syntax and conventions; the plan is to propose a design similar in concept to Kawa, but compatible with R7RS syntax and concepts. BTW Kawa supports mutually dependent modules/libraries, which neither R6RS nor R7RS support, though in practice it seems very desirable It does add some complication, of course, and some semantic issues - but I think they're not inherently worse than mutually dependent definitions in a single top-level. (Though if you start worrying about phasing ... My solution is to not worry about phasing.) Note a related issue: Once you associate a library with a file, then you probably want to also define naming convention so you can find a library's file name from the library name. That is considered outside the scope of R7RS, but I think it would be suitable for the SRFI I'm talking about. -- --Per Bothner [email protected] http://per.bothner.com/ _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
