• Pitri@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    there is no reason for a (non-foreach) for loop to be any more or less finite than a while loop.

    for (a; b; c)
    {
      d;
    }
    

    is just syntactic sugar for

    {
      a;
      while (b)
      {
        d;
        c;
      }
    }
    

    in most or all languages with c-like syntax.