> What I see in your example is binding, but I don't see with-local-
> vars anywhere. Or did I misunderstand something?

Sorry, I checked the compojure source again and the servlet headers,
cookies, etc are wrapped in a "with-servlet-vars" macro (rather than
with-local-vars) which just uses let. The html parameters are wrapped
in *params* using binding rather than with-local-vars, so my example
does not actually demonstrate with-local-vars, but rather just
thread-local use of vars with binding.

On Fri, Feb 13, 2009 at 5:19 PM, Konrad Hinsen
<konrad.hin...@laposte.net> wrote:
>
> On Feb 13, 2009, at 15:35, Adrian Cuthbertson wrote:
>
>> Have a look at compojure - a good example of with-local-vars is where
>> a servlet request is executed. Each (get, post) request occurs in its
>> entirety on a single (jetty or tomcat) thread. The compojure call to
>> the application service function binds the http headers, servlet
>> request parameters, etc, using with-local-vars and then calls the app
>> function. These values are all then in scope for the called service
>> function _and_ any functions that it in turn calls. This is all safe
>> without using refs/atoms as the values are all "local-thread" bound.
>
> What I see in your example is binding, but I don't see with-local-
> vars anywhere. Or did I misunderstand something?
>
> Konrad.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
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