Comment by tajpulo

3 months ago

I think we have a similar way of thinking. I once wrote a blog post about a for loop extension (based on Golang for illustration) [0].

  values := []string{"hello", "world"}
  for v, value := range values {
    fmt.Printf("%s", value);
  }
  inter {
    fmt.Printf(",")
  }
  before {
    fmt.Printf("[")
  }
  after {
    fmt.Println("]")
  }
  empty {
    fmt.Println("(nothing found)")
  }

[0] https://lukas-prokop.at/articles/2024-04-24-for-loop-extensi...