On Sat, Aug 8, 2009 at 9:52 AM, Rich Hickey <richhic...@gmail.com> wrote:

>
> On Sat, Aug 8, 2009 at 5:53 AM, Meikel Brandmeyer<m...@kotka.de> wrote:
> > Hi,
> >
> > Am 08.08.2009 um 02:52 schrieb samppi:
> >
> >> Great, thanks. Is clojure.lang.Var/pushThreadBindings a public,
> >> supported part of the API? Can I use it without fear of suddenly
> >> dropped support?
> >
> > It is was `binding` uses internally. Unfortunately
> > this is not exported by Clojure's public API. I -
> > unfortunately - have to rely on this hack.
>
> get-/push-/pop-thread-bindings wrapping Var.get/push/popThreadBindings
> would be a welcome issue/patch.
>
> Note the addition of getThreadBindings(), which returns a map of all
> the current bindings. This could be used to define a
> function-returning macro that can be used when you want to pass a
> helper function to another thread and have it use the bindings in
> effect at the point of its creation.
>

It occurs to me that the above would also allow stored functions to carry
thread-local bindings with them. The obvious application being to fix the
interaction between thread-local bindings and lazy seqs. They could also
potentially even be used in code run in a future.

--~--~---------~--~----~------------~-------~--~----~
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
Note that posts from new members are moderated - please be patient with your 
first post.
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