Clojure

thread-local bindings interface

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

The attached patch provides a clojure side interface to clojure.lang.Var get/push/popThreadBindings. Also modified binding to use these new functions.

Discussion here:
http://groups.google.com/group/clojure/browse_frm/thread/69367d3981de81d1

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/169 Attachments: 0001-Added-public-thread-local-bindings-interface.patch - https://www.assembla.com/spaces/clojure/documents/ahljteHgqr3PfqeJe5afGb/download/ahljteHgqr3PfqeJe5afGb
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: [file:ahljteHgqr3PfqeJe5afGb]: Patch adding thread-local bindings interface

Show
Assembla Importer added a comment - meikelbrandmeyer said: [file:ahljteHgqr3PfqeJe5afGb]: Patch adding thread-local bindings interface
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: You may want to consider the concerns Vincent Toups (jvt) raised in the above mentioned thread about possible runtime issues with invalid built maps. Obviously Common Lisp and Scheme do not allow such a behaviour.

Show
Assembla Importer added a comment - meikelbrandmeyer said: You may want to consider the concerns Vincent Toups (jvt) raised in the above mentioned thread about possible runtime issues with invalid built maps. Obviously Common Lisp and Scheme do not allow such a behaviour.
Hide
Assembla Importer added a comment -

oranenj said: This is just a style nitpick, but IIRC Rich mentioned that new code in core should use the "modern" syntactic sugar for . forms, instead of . directly. I certainly would like to see . marginalised as much as possible.

Also, do you think the operations have destructive semantics? Should the names contain a '!'?

Other than that, the patch is so simple there isn't much to review, and I'm definitely in favour of adding this.

Show
Assembla Importer added a comment - oranenj said: This is just a style nitpick, but IIRC Rich mentioned that new code in core should use the "modern" syntactic sugar for . forms, instead of . directly. I certainly would like to see . marginalised as much as possible. Also, do you think the operations have destructive semantics? Should the names contain a '!'? Other than that, the patch is so simple there isn't much to review, and I'm definitely in favour of adding this.
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: Ah. Ok. I asked Rich why he was still using .. while ��� is much more general. He said, that it is a classic. So I thought I'd stick to the current style in core.

I'm not sure about the 'Unable to render embedded object: File ('. On the one hand a push should always have a corresponding pop and vice versa. For example a pop without push will throw. So for now I would not add the ') not found.'.

I'll also add the modifications as discussed in:
http://groups.google.com/group/clojure-dev/browse_frm/thread/962c19c40dd93f24

Show
Assembla Importer added a comment - meikelbrandmeyer said: Ah. Ok. I asked Rich why he was still using .. while ��� is much more general. He said, that it is a classic. So I thought I'd stick to the current style in core. I'm not sure about the 'Unable to render embedded object: File ('. On the one hand a push should always have a corresponding pop and vice versa. For example a pop without push will throw. So for now I would not add the ') not found.'. I'll also add the modifications as discussed in: http://groups.google.com/group/clojure-dev/browse_frm/thread/962c19c40dd93f24
Hide
Assembla Importer added a comment -

richhickey said: I think the docs for push-thread-bindings should state that it is essential to have a matching call to pop-thread-bindings that will be properly called in all scenarios (i.e. in a finally clause), and that this is a special purpose function, and 'bindings' or other high-level macros should be preferred when suitable.

Show
Assembla Importer added a comment - richhickey said: I think the docs for push-thread-bindings should state that it is essential to have a matching call to pop-thread-bindings that will be properly called in all scenarios (i.e. in a finally clause), and that this is a special purpose function, and 'bindings' or other high-level macros should be preferred when suitable.
Hide
Assembla Importer added a comment -

meikelbrandmeyer said: (In [[r:110b9c2eb8a128d837e6e620efc7e1c4e33feb82]]) Added public thread-local bindings interface

Added push-thread-bindings, pop-thread-bindings and get-thread-bindings
to interface with clojure.lang.Var for thread-local bindings.

Modified binding to use the new interface.

Fixes #169

Signed-off-by: Chouser <chouser@n01se.net>

Branch: master

Show
Assembla Importer added a comment - meikelbrandmeyer said: (In [[r:110b9c2eb8a128d837e6e620efc7e1c4e33feb82]]) Added public thread-local bindings interface Added push-thread-bindings, pop-thread-bindings and get-thread-bindings to interface with clojure.lang.Var for thread-local bindings. Modified binding to use the new interface. Fixes #169 Signed-off-by: Chouser <chouser@n01se.net> Branch: master

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: