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

That's a good example

  shirt.blue? and return bar
would be equivalent to

  return bar if shirt.blue?
You can do the same with or and unless.


I find the postfix if and unless far more readable than the Perlish and and or operators. The "or die" construction for asserts is really amusing though.




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: