On May 12, 4:41 pm, Phil Hagelberg <p...@hagelb.org> wrote:
> On Sat, May 12, 2012 at 11:06 AM, John Gabriele <jmg3...@gmail.com> wrote:
>
> > By the way, I like that you can now pass extra args to `lein new` to
> > create a project of a specific type (such as plugin). What do you
> > think of adding 2 more stock options: application and library?
>
> What would the difference between the two be? If it's just a matter of
> whether there's a :main function then it might be simpler just to have
> a commented-out line in project.clj. If there are other differences
> then maybe it would be justified.

Hi Phil,

It's my understanding that the differences are:

  * an app would have `:main foo.core` in the project.clj
  * an app would have the `-main` function in core.clj
  * an app would have a :gen-class in its ns declaration in core.clj

And also different default README's. An app would start with
instructions on how to run the app (`java -jar your-app-0.0.1-
standalone.jar` plus valid options/args) whereas a lib would start
with info on:

  * what to put into your project.clj to use this lib
  * what to `require` in your code's ns declaration, plus usage
examples (similar to how many Perl 5 modules have a useful "SYNOPSIS"
section near the top)

Another important reason for having a good default README.md template
specifically for libs is that, at some point, I'm guessing that
clojars.org will extract and render them as html, and it will be nice
if there's some conventions already in place.

---John

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to