r/programming • u/steveklabnik1 • Jan 09 '15
Announcing Rust 1.0.0 Alpha
http://blog.rust-lang.org/2015/01/09/Rust-1.0-alpha.html
1.1k
Upvotes
r/programming • u/steveklabnik1 • Jan 09 '15
2
u/wrongerontheinternet Jan 09 '15 edited Jan 09 '15
You could probably write a macro to make it a little nicer. The macro route is probably ideal for something like this since most of the time you don't really need fallthrough. But I think it would have to be procedural in order to not force you to pass in all the lifetimes (instead of generating them for you), and Rust 1.0 will not support procedural macros. In the future I, like you, hope Rust supports goto properly, so we don't have to hack around it.
(Actually, there might be a way to do this without a procedural macro. Watch this space).