On 12-06-14 1:45 PM, Patrick Walton wrote:
On 6/14/12 1:41 PM, Graydon Hoare wrote:
However, we nicely dodged that bullet by not supporting ++ and -- at
all. Very prescient :)

Not really. Reoccurs with foo["bar"] += 1;

Well, there's a fairly straightforward desugaring: foo["bar"] =
foo["bar"] + 1; For ++ it's less certain (you have to dummy up a 1
constant of... some type?)

No, this just kicks the can one step further down the road; it's back to losing the whole point of the += in-place optimization. Which is what the user wrote and the library-author wants to provide.

I think .. actually I think we want it to turn into:

  foo.lval_index("bar", |x| x += 1);

But as Niko suggests, this really requires a day at a whiteboard to go through the variations and make sure it all hangs together.

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

Reply via email to