On 5/29/2012 1:07 AM, David Rajchenbach-Teller wrote:
As promised, I have attempted to rewrite my original function |move|
with a mechanism that would let us define issue-handling policies. This
mechanism is inspired by both the current thread and the previous thread
on exceptions, a few months ago.
So far, the result is not too convincing yet, but it can certainly serve
as a base for improvements: https://gist.github.com/2823196
Hi!
Sorry I've been away, I wanted to talk about this issue, or, well, kinda
just remind you and others in this conversation that there is (in my
mind at least, and in the bug tracker[1]) "a plan" for how to do this.
I've been continuing to assume this is something we'd handle with
per-task dynamic-scoped values, just haven't got around to implementing
them yet. Should be almost entirely library code.
Here's a sketch of your 'move' function written in this style:
https://gist.github.com/1f9c8fe1debd9a504eef
I think a sufficiently gnarly implementation that's allowed to hang a
special-variable list off the side of each task should be able to work
given that, just keying off the different addresses of the various
consts in memory. A bit of a hack but I think it might work.
Note as discussed earlier, in that example the handling all happens _at_
the dynamic site of signalling (via a call to a passed-down closure,
accessed through the handler library) not by unwinding. Unwinding still
only happens on failure and is still idempotent, unrecoverable.
Does this not sit well with you currently?
-Graydon
[1] Existing plan:
https://github.com/mozilla/rust/issues/1945#issuecomment-4425610
https://mail.mozilla.org/pipermail/rust-dev/2011-November/000999.html
https://github.com/mozilla/rust/issues/1857
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev