On 11/30/13 8:32 AM, Tiffany Bennett wrote:

On Sat, Nov 30, 2013 at 9:34 AM, Oren Ben-Kiki <[email protected]
<mailto:[email protected]>> 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. And then there's the possibility of
    modifying variables... It sounds like a lot of effort working around
    something the compiler can do automatically and actually already
    does automatically; all it needs is the ability to communicate the
    programmer intent via the type system so it can support and enforce it.


I agree, having annotations so that the type system can enforce safety
is a better idea than hacking around it with alternate versions of every
function for taking closures only used once.

You don't need alternate versions: you just need one version that passes arguments through.

I don't agree in general that the right solution for every problem that can be solved through the type system is in the type system. Every type system feature has a cost; when something can be done via what's already present in the language then it becomes difficult to justify adding more features to what is already a quite complex type system by industry standards.

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

Reply via email to