I really like the "close it as the last item in the sequence" trick.  Sadly,
I don't see how it can be made exception safe.

On Wed, Feb 25, 2009 at 9:02 AM, Stuart Sierra
<the.stuart.sie...@gmail.com>wrote:

>
> On Feb 25, 8:29 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> > That's interesting. I almost never use doall or dorun together with
> > map. I found that most side-effects don't give interesting result
> > values.
>
> I often find I need to do this when the mapping function depends on a
> dynamic context, like an open stream or an SQL connection. I'm not
> using side effects in this case, but I have to make sure that the
> sequence is completely realized before leaving the scope in which it
> was created. This issue has been mentioned before, but there doesn't
> seem to be a good general-purpose solution.
>
> -Stuart Sierra
> >
>

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