News for hackers. Stuff that matters.
Re:Things Rust shipped without by jasode on Friday July 03, 2015 @03:51PM (#9827594)
>In C++ labeled breaks would make 'goto' completely obsolete.

In 20 years of using C/C++, I've found one use for "goto" that's hard to substitute: simulating coroutines that yield to an outer context. (Similar to C# yield return).

A "break label" gets you out of a loop. I needed to use "goto" to jump back into the middle of a loop to resume where the "coroutine" previously left off. The keywords "break/setjmp/longjmp" wouldn't have been substitutes for this particular use case.

Re:Things Rust shipped without by prutschman on Friday July 03, 2015 @04:22PM (#9827732)
I've used a switch statement essentially as a jump table for this purpose. I'm curious whether that would have worked, or if you were doing something different enough that you needed a goto.
Re:Things Rust shipped without by IsTom on Friday July 03, 2015 @06:54PM (#9828346)
I don't quite understand how it's not a setjmp/longjmp usecase. Isn't this exactly what longjmp is for?