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

Re: put library <body> at top-level

Ray Blaak wrote:
>>> - sometimes many
>>> small libraries are best expressed in a single file,
>> I think this is fairly rare, and not a very important use case.
>> If they're small, why should they be separate libraries? 
> The organization of libraries can be done for reasons other than size: 
> purpose, ownership, units of work, etc.

If you do want to reflect this organization in the lib-path, then the
point about having multiple libraries per source unit is moot.

If you want some organization that is not reflected in the lib-path,
you could have:
In toms-libraries.scm:
   (library "stack" ...)
   (library-vector "queue" ...)

In bills-libraries.scm:
   (library "math" ...)
   (library "matrix" ...)

But is this really any advantage over:
In stack.scm:
   ;; Owner: Tom
   (define stack ...)

In math.scm:
   ;; Owner: Bill
   (define (sum-sqrt ...) ...)

This does suggest a "meta" feature.  Instead of "Owner" in a comment,
one might want:

In math.scm:
   (meta 'Owner "Bill")
   (define (sum-sqrt ...) ...)

Here meta is a standard hook to add meta-information about a library.
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/