On 26 July 2010 06:42, ghadi <[email protected]> wrote:
> I really appreciate this article.  Some of the compojure web
> development documentation is hard to find or out of date.  I usually
> end up reading the source to have a better idea of what's going on.
> Clojure makes that pretty easy though.
>
> A couple quick questions:
>  1)  Inside (view-input), there are a couple of tuples        :value
> a and :value b.  a and b don't seem to be declared.
> What do they refer to, or are they just not evaluated?

That's a typo/bug.

Further down the page he says you should replace the view-input
definition (in order to implement the error handling) and there he has
the right arglist.  i.e. it should be:

(defn view-input [& [a b]] ...)

Also, I suspect other people just checked out the code from the Git
repository and didn't see this.  I did not and noticed this problem
last night when I read the article.

>  2)  Inside the POST "/" route, how does Compojure match a and b with
> request parameters?  Does it go based on the query string?
>   It doesn't matter in this example since addition is commutative,
> but I'm just wondering how it works behind the scenes.

Ah, good point.  I didn't think of that.  I imagine it converts the
symbol name into a string and looks for a field name that matches, but
it's just a guess.

> Anyways, congrats on a great tutorial.

Yes, I agree.

-- 
Michael Wood <[email protected]>

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

Reply via email to