I think that would certainly help to make contrib more scalable and
navigable going forward...
2009/8/7 Sean Devlin <francoi...@gmail.com>:
>
> Howard,
> I am confused with the _1 in response to my second point. Is that
> supposed to be +1 or -1?
I think it's meant to be '+1' (he hit '-' instead of '=' which
produces '_' when shifted).
And +1 for the test code restructure from me, too.
> Thanks,
> Sean
--
! Lauri
I thought it was an amusing pun on
how_package_names_translate_to_filenames. :)
1. Create a test directory, and all tests live in test/clojure/contrib
2. Each test suite file is named my_ns_test.clj
3. Each test suite is in the clojure.contrib.my-ns-test namespace.
4. Create a docs directory for manually written *usage* documentation.
5. Each namespace has a my-ns.markdown file in docs. Just about every
function gets asked "How does this work?" at least once on the mailing
list. Simply copying this down into the docs dir will make thing more
accessible to new users. This hopefully will cut down redundant
chatter, and give Mr. Halloway a head start on his next book :)
6. Modify the autodocs script to prepend the manually written docs to
the output. Here's roughly what the new autodocs routine would look
like
(str (slurp "docs/my-ns.markdown")
"\n-----\nReference\n"
(toms-autodoc-routine ...))
Tom,
1. Excellent point about the one-to-one relationship. I think you
pprint lib is an excellent example. So, if understand what you're
saying correctly, the pprint test dir would look like
test/clojure/contrib/pprint/ns_1_test.clj
test/clojure/contrib/pprint/ns_2_test.clj
etc...
and the namespaces would be
clojure.contrib.pprint.ns-1-test
clojure.contrib.pprint.ns-2-test
etc...
3. Storing usage docs in the ns docstring seems like a good idea,
especially to start. As some namespaces get more involved (think duck-
streams, str-utils-2, seq-utils), the documentation will grow too.
These would be good candidates to have their own entry in the doc
directory. For now, I think this is best handled on a case by case
basis.
4. I personally like markdown because github will automatically
convert it to html for me. Also, I hate worrying about closing tags,
but I can get over it. As an example, check out the docs directory on
my personal clojure utils: http://github.com/francoisdevlin/devlinsf-clojure-utils/tree/master
5. I think there should be a stronger emphasis on testing, so that
design intent is captured. I agree that keeping contrib as a
playground is important for now. However, I would ask everyone here
to please include tests with you submission, even if it's only a few
cases captured from the REPL. Otherwise, you end up with ambiguities
like this http://groups.google.com/group/clojure/browse_thread/thread/8d85d6a57b294611
.