Re: Defining a library in one file

Carl Gay <[email protected]>
Newsgroups gmane.comp.lang.dylan.gwydion.devel
Message-ID <CALekcH2nHxN=oqoYxTmAm5tW2+ZbVJ9YWOBfsieQsAq50viV_A@mail.gmail.com>
On Sun, Feb 17, 2013 at 3:57 PM, Dustin Voss <[email protected]> wrote:

> On Feb 17, 2013, at 7:21 AM, Hannes Mehnert <[email protected]> wrote:
>
> > Hi Carl,
> >
> > I appreciate that step forward.
> >
> > I'd consider naming the keywords "Use-Libraries" and "Use-Modules"
> > (these are case-independent according to DRM anyways), and then limit
> > the header to one occurrence of these keywords - similar to what
> > Gwydion Dylan does/did for compatibility.
> >
> > I would require each "Use-*" keyword to span over a single line, which
> > is generally true for the file headers of Dylan files (see
> > http://opendylan.org/books/drm/Dylan_Interchange_Format).
>
> You mean like this?
>
> Use-Libraries:
>     common-dylan, exclude: { simple-io };
>     io
> Use-Modules:
>     common-dylan, rename: { debug-message -> log },
>           export: log;
>     format-out;
>

This is what I guessed also.  I think this way works really well for (what
I hope is) the common case of importing entire modules, taking all defaults:

Use-Libraries: system, logging, io
Use-Modules: operating-system, logging, format-out

The down side is the slightly more awkward-looking (IMO) long format in
your example, with semicolons.


>
> It might be simpler to just map each header to a single definer clause
> rather than a semicolon-separated list of clauses, and keep it as
> “Use-Library” and “Use-Module”.
>

As I mentioned, I don't have a strong preference.  They both seem to work.
 If anyone else wants to weigh in, please do.


>
> I might also suggest adding “Module-Creates” as follows (keeping the
> noun-verb pattern):
>
> Module-Exports:
>     log-to-file
> Module-Creates:
>     log-formatter, *log-file-name*
>

I confess to not being sure whether this makes any sense in a singe-module
library.  I've only ever seen it in libraries that define several modules.


>
> Or perhaps call them “Export-Module-Names” and “Create-Module-Names” to
> keep the verb-noun pattern of “Use-Library” and “Use-Module”.
>

Or simply "Export-Names" and "Create-Names".  I like it.
 ("Export-Module-Names" sounds like it's exporting names of modules not
names of definitions in a module.)


>
> BUT! Overall, sounds good to me.
>
> —Dustin.
> _______________________________________________
> hackers mailing list
> [email protected]
> https://lists.opendylan.org/mailman/listinfo/hackers
>

_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.