Re:Read this post ‘unless’ you’re not a Ruby developer
by shric on Tuesday December 13, 2022 @04:37AM
(#33966569)
I'm mildly surprised the article doesn't mention that Perl, one of the languages that influenced Ruby, also has unless.
[ Parent
| on HN ]
Re:Read this post ‘unless’ you’re not a Ruby developer
by rjsw on Tuesday December 13, 2022 @07:59AM
(#33968256)
Common Lisp has unless too, I use it where it makes sense.
Re:Read this post ‘unless’ you’re not a Ruby developer
by dgunay on Tuesday December 13, 2022 @05:21AM
(#33966849)
In Perl you can write postfix conditionals: `thing() unless $condition`, which at least is more natural usage of "unless" to a native English speaker than the other way around. That's the best way to use it IMO.