Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That looks so much like Elixir.

    for x <- 1..100 do
      case [rem(x, 3), rem(x, 5)] do
        [0, 0] -> IO.puts("FizzBuzz")
        [0, _] -> IO.puts("Fizz")
        [_, 0] -> IO.puts("Buzz")
        _ -> x
      end
    end


Any language that has pattern matching looks similar. Much nicer than if/else/switch.


Indeed both of those look so much like ML which predates them by a few decades.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: