This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Something like defpackage?


On 09/10/2010 01:07 PM, David Dreisigmeyer wrote:
I was wondering if/how it would be possible in Kawa to do something
like Common Lisps's defpackage?

I don't think defpackage makes sense. Common Lisp packages are based on information modularity based on packages, but modern languages tend to go with "modules" directly. R6RS has "libraries". Kawa has "modules" which are very similar to R6RS libraries. The main difference is that Kawa associates a module with a source file: A module has a set of top-level names, some of which may be module-private, and some of which may be exported. Another module (including the top-level) may "import" bindings from other modules. You can use the Kawa require form, or the R6RS import. Kawa's version of import is the same as R6RS's, except it is used as a top-level declaration. Think of a Kawa module as a "flattening" of the R6RS library form: Each module is an implicit library form, with a slightly different syntax. -- --Per Bothner per@bothner.com http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]