Skip to main content
19 events
when toggle format what by license comment
Aug 6 at 22:21 vote accept Dannyu NDos
Jul 30 at 18:38 history protected Michael Homer
Jul 30 at 14:48 answer added Ben Voigt timeline score: 2
Jul 30 at 10:10 answer added Ralf Kleberhoff timeline score: 4
Jul 29 at 22:23 comment added Bergi Ah, right, I had forgotten about these. The example might be easier to understand if you actually used the return value (let result = …) in the code.
Jul 29 at 22:19 comment added Dannyu NDos @Bergi doc.rust-lang.org/rust-by-example/flow_control/loop/return.html
Jul 29 at 22:04 comment added Bergi I understand the use of a label like break 'outer;, but what do foo and bar refer to in your break statements?
Jul 29 at 11:03 comment added Austin Hemmelgarn @DannyuNDos The way you propose using it is functionally equivalent to storing the value in a variable from the target scope and then executing a goto to a predefined location. It’s not quite as bad as an actual goto because it can only jump to a clearly defined location, but it’s still the same kind of control flow.
Jul 29 at 10:28 answer added DannyNiu timeline score: 5
Jul 29 at 7:10 history edited feldentm
edited tags
Jul 29 at 7:08 answer added feldentm timeline score: 2
Jul 29 at 6:28 comment added RonJohn @DannyuNDos of course it is. Every loop, for, while, if, and break is a goto. The language -- and the people who use the language -- just don't want to admit it. (Yes, I'm a greybeard who wrote in line-number BASIC and in assembly.)
Jul 29 at 5:01 history became hot network question
Jul 29 at 0:01 answer added Michael Homer timeline score: 14
Jul 28 at 21:13 comment added user23013 Java, as a major C-like language, supports this.
Jul 28 at 21:08 comment added Dannyu NDos @NaïmCamilleFavier Yeah, but break is not goto.
Jul 28 at 21:04 comment added Naïm Camille Favier en.wikipedia.org/wiki/Goto#Criticism
Jul 28 at 21:03 history edited Dannyu NDos
edited tags
Jul 28 at 20:53 history asked Dannyu NDos CC BY-SA 4.0