On 11/30/13 6:34 AM, Oren Ben-Kiki wrote:
That would help a bit, but it would still require the programmer to
manually setup and teardown the tuples, pass them to the closure, and so
on. We'll also need to change each and every function that takes an
action parameter to take the extra tuple in every container or
container-like type.

As I mentioned before, most of those in the library can be turned into RAII. (I made informal measurements of the number of them that could be RAII-ified when I was removing "do"; the vast majority would be better as RAII.) Some of those that can't are generic container traits that wouldn't benefit from `once fn` anyway. For the remainder, adding the tuples doesn't seem much of a burden to me.

If it is, we can always add `once fn` if we have to, but we haven't really tried not having it.

And then there's the possibility of modifying
variables...

Can you elaborate? You can already use "mut" on individual pattern bindings, including individual elements of destructured tuples.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to