Hacker News new | past | comments | ask | show | jobs | submit login
Compojure - Clojure web framework (github.com/weavejester)
45 points by maryrosecook on Jan 20, 2009 | hide | past | favorite | 5 comments



Last night I added an entry to Things: "build something in Compojure". I'm taking suggestions.


I am sure this has been discussed to death somewhere else (point me there?) but what is the advantage of adding [ ] for defining arguments to a proc/lambda? I assume it is to help it stand out a little more? What I love about lisp/scheme is the symmetry and simplicity in syntax - though it does clearly state in the scheme spec that [ ] are reserved for future language revisions.


Clojure extends the syntax of Lisp to include first class support for data structures other than lists (vectors, sets and maps).

Vectors are the [ ] structure you see. You can use ( ) to specify a number of function bodies which differ on arity e.g:

  (defn foo ([x] x) ([+ x y])
So it's not to stand out more, rather it's extending the Lisp syntax to make items other than lists "first-class" whilst retaining the homoiconic properties of Lisp.


I like the DSL-ish style of routing (http method, url pattern, handler method/block). The same thing is used in Sinatra (http://sinatra.github.com/):

    get '/' do
        'Hello world!'
    end


Compojure was created by James Reeves, who said:

"The language I work with from day to day is Ruby, so Compojure has a lot in common with lightweight Ruby frameworks like Sinatra, and less with existing Java frameworks. It's designed for impatient, lazy people like myself, so it's quick to install and quick to start developing in."

http://groups.google.com/group/clojure/browse_thread/thread/...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: