Re: Sessions for Ring

2010-02-03 Thread Vagif Verdi
On Feb 3, 7:18 pm, James Reeves wrote: > On Feb 3, 8:44 pm, Vagif Verdi wrote: > > This again is something that's limited to Compojure, and not > necessarily indicative of a problem with the functional approach. I agree. As long as session implementation is robust and simple to use without corn

Re: Sessions for Ring

2010-02-03 Thread James Reeves
On Feb 3, 11:31 am, Rich Hickey wrote: > One idea is to pass commute-like and deref-like functions to the > handling code for sending change to, and accessing, the session state. > The state will be an immutable value as usual. This encapsulates > everything about the session data. That's an inte

Re: Sessions for Ring

2010-02-03 Thread James Reeves
On Feb 3, 8:44 pm, Vagif Verdi wrote: > Invalidating sessions do not work. James replied that it would be hard > to fix with immutable > sessions:http://groups.google.com/group/compojure/browse_thread/thread/b27ab40... Actually, I was completely wrong in that instance. I'm not sure what I was th

Re: Sessions for Ring

2010-02-03 Thread Vagif Verdi
On Feb 3, 3:55 pm, Mark McGranaghan wrote: > One thing that would help us a lot with choosing the right interface > for sessions is examples of session use from real application code. We > have considered simple examples like incrementing a counter and > logging in / logging out (http://gist.githu

Re: Sessions for Ring

2010-02-03 Thread Mark McGranaghan
Hi Vagif, On Feb 3, 4:27 pm, Vagif Verdi wrote: > Whatever you guys chose, do not go the immutable road. Compojure took > that approach and now many people (including me) are stuck with > situations where they need to update session in a middle and pass it > somewhere else, and they can't. Sessio

Re: Sessions for Ring

2010-02-03 Thread Vagif Verdi
Whatever you guys chose, do not go the immutable road. Compojure took that approach and now many people (including me) are stuck with situations where they need to update session in a middle and pass it somewhere else, and they can't. Session is a data storage, just like a database. One of the str

Re: Sessions for Ring

2010-02-03 Thread Rich Hickey
On Wed, Feb 3, 2010 at 8:27 AM, James Reeves wrote: > Hi folks, > > Mark McGranaghan and I have recently been working on new functionality > for Ring, a web application library for Clojure. Ring is similar to > Rack on Ruby, and provides a simple, functional interface for handling > HTTP requests.

Re: Sessions for Ring

2010-02-03 Thread James Reeves
On Feb 3, 9:21 am, Eric Lavigne wrote: > With the same issue in mind, I propose design 3. Like design 1 except > (ref {}) instead of (atom {}) because I may want to coordinate changes > between the session and some other transaction-aware state. Sessions can be implemented with many storage engin

Re: Sessions for Ring

2010-02-03 Thread Eric Lavigne
> Currently we have two possible designs: > > Design 1: > The session is stored as an mutable atom map in (request :session). To > update the session, use the standard Clojure swap! function, e.g. > > Design 2: > The session is an immutable map in (request :session). To update the > session, add th

Sessions for Ring

2010-02-03 Thread James Reeves
Hi folks, Mark McGranaghan and I have recently been working on new functionality for Ring, a web application library for Clojure. Ring is similar to Rack on Ruby, and provides a simple, functional interface for handling HTTP requests. We've recently added support for urlencoded parameters and coo