On Wed, Aug 13, 2025 at 10:28:20PM +0100, Willow Liquorice wrote:
> Zig doesn't have `goto` because it's a redundant language feature.
> 
> Zig uses an idiom that is, in effect, a structured subset of goto 
> functionality: labelled blocks, `break`s, and `continue`s. The ability 
> to label `for`, `while`, and `switch` expressions, along with blocks, 
> means that the use case of navigating nested control structures is 
> already done.

  Ou. But this is very redundant! Labeled breaks, continues, for, while,
switch - all these can be replaced by goto ;-). If you want
to write a simple and fast parser/lexer, then a goto is your choice.
IMHO, we shouldn't waste a time thinking how to replace a goto, we
already have goto and should just learn how to use it best.


-- 
Олег Неманов (Oleg Nemanov)

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Ta74fdc99bf0151a0-M92b702889b88eb1e6624b728
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to