Re:Philosophy and "for" loops — more from Go and Rust
by kzrdude on Thursday July 11, 2013 @10:43AM
(#6026302)
but the `break`/`return` syntactic sugar inside for-loop closures will be lost.
[ Parent
| on HN ]
Re:Philosophy and "for" loops — more from Go and Rust
by kibwen on Thursday July 11, 2013 @10:51AM
(#6026362)
To be fair, it wasn't so much "syntactic sugar" as it was "a compiler hack that was rarely used and didn't even suffice for a large class of cases involving borrowed pointers".
Re:Philosophy and "for" loops — more from Go and Rust
by dbaupp on Thursday July 11, 2013 @11:16AM
(#6026533)
And, it is an incorrect compiler hack (https://github.com/mozilla/rust/issues/6675), but that's not saying much at the moment.
Re:Philosophy and "for" loops — more from Go and Rust
by rntz on Thursday July 11, 2013 @10:47AM
(#6026330)
Yes. You might be able to get something like it back with Rust's macro system, though. But it's probably better just to use the new syntax & iteration protocol, assuming the Rust folks come up with something reasonable.