

GetClojure: Tons of Searchable Clojure Examples - devin
http://getclojure.org/

======
Illotus
Very nice idea. I recommend trying to move to direction where you get results
for 'ring', 'compojure' and 'friend', ie. examples for prominent frameworks
and libraries.

------
Anderkent
Cool idea, but lack of results for `deftemplate` suggests that you're not
scraping enough :) It's the non-core stuff that's more likely to need scraped
examples.

~~~
devin
Anderkent, all of the examples you see at the moment were run through a
sandbox so I could capture their value and output. I would love to open it up
to more forms and libraries in the future. The plan is to give users the
ability to add, edit, and rate examples so things like `deftemplate` could be
included. Either way, thanks for checking it out and giving feedback.

------
jared314
Nice. A link to the file and project of each example would be great for usage
context.

What is it scraping? Is it just Github projects with language "Clojure"?

~~~
devin
IRC logfiles, mostly. You're seeing examples of code snippets typed into IRC
from the last 4-5 years run in a sandbox under Clojure 1.5.1. I also ran it
over the ClojureDocs s-expressions. There are a lot of examples missing (defn,
def, etc. for instance) due to the fact that I didn't want to inadvertently
run something evil, but FWIW there are over 30k examples of sequence
functions, JVM interop, etc. In a previous comment I mentioned that my plan is
to add the ability to submit, edit, bookmark, and rate examples.

RE: GitHub projects tagged "Clojure": I think exploring Codeq
([https://github.com/Datomic/codeq](https://github.com/Datomic/codeq)) would
be a cool way to go about doing that kind of thing.

~~~
jared314
Last time I tried codeq, the analyzer was limited to symbols defined outside
of functions. The Clojurescript parser might be a better option, because the
parse tree would allow indexing usages inside functions.

I also wonder if a generative testing library could be used to generate
examples.

