From: Brian Candler Date: 2003-08-06T20:53:31+09:00 Subject: Re: Why does Ruby have callcc? On Wed, Aug 06, 2003 at 08:38:25PM +0900, Harry Ohlsen wrote: > I'd be interested to read about some real-world examples where people have > used callcc, not just to try it out, but because it was the "right" way to > do something (for efficiency, or code brevity or whatever reason). I think Seaside/Borges falls into this category. I haven't had a chance to use it in anger, but I think the idea is that continuations can represent CGI session state; you code can be written in a linear fashion (e.g. display page, fetch response, display next page, fetch next response etc) without any explicit session maintenance. Furthermore, by retaining continuation objects which represent earlier pages, it will work even if the user clicks 'back' in their browser and re-enters data in a previous form. I'd have a number of concerns in a practical application - I'd want old continuations to expire and be garbage-collected so that they don't cause infinite memory growth - but otherwise it sounds like a great way to write web applications. Regards, Brian.