Skip to content

Instantly share code, notes, and snippets.

@nagat01
Created September 2, 2024 13:47
Show Gist options
  • Select an option

  • Save nagat01/ddc459564626f6ed3179785d3371c7cc to your computer and use it in GitHub Desktop.

Select an option

Save nagat01/ddc459564626f6ed3179785d3371c7cc to your computer and use it in GitHub Desktop.
extension (x: String)
def +: (y: String) = s"$x + ($y)"
def ++ (y: String) = s"$x + ($y)"
@main def main =
println("a" +: "b" +: "c") // a + (b + (c))
println("a" ++ "b" ++ "c") // a + (b) + (c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment