News for hackers. Stuff that matters.
Re:Linux: Using goto In Kernel Code (2003) by afiori on Saturday July 17, 2021 @07:11AM (#27865005)
I would also like continue to work that way, so that every (labelled) block can be freely looped and exited (with a value)
Re:Linux: Using goto In Kernel Code (2003) by chrismorgan on Saturday July 17, 2021 @07:16AM (#27865019)
I don’t think I’d want continue to work on a block. Repeating the block seems different from leaving the block early (which can already be done with return or with panicking). I think it’s better to need to write it as a loop before you can continue.
Re:Linux: Using goto In Kernel Code (2003) by afiori on Monday July 19, 2021 @04:38AM (#27880404)
I completely agree, In rust looping has important semantics with regards to lifetimes and ownership so the continue part would be a bad idea. I think it would be cool in something like javascript (if blocks could return values...)