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

> In Ruby, only nil and false are false, so you can use || to catch 0s and empty strings.

But there's still trouble with things like boolean configuration variables ...

> In Perl [...] there's the // operator

Thanks for mentioning that! [1] The // operator is indeed a clean operator, almost equivalent to COALESCE.

So we have Perl and SQL. Any other language with such an operator?

[1] http://perldoc.perl.org/perlop.html#C-style-Logical-Defined-...



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

Search: