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

> Ruby's case statements are super-awesome

Most functional languages have, I think, somewhat better systems in that there's less magic[0], you can unwrap/extract values and you can add further conditions on values (guards)[1][2][3].

Some modern multiparadigm languages have lifted this style e.g. Scala or Rust.

[0] because case/when relies on the non-commutative `===` its behavior can be surprising

[1] http://learnyouahaskell.com/syntax-in-functions#case-express...

[2] http://learnyousomeerlang.com/syntax-in-functions#in-case-of

[3] http://en.wikibooks.org/wiki/F_Sharp_Programming/Pattern_Mat...



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: