3 ms·
I like the use of language in perl and wish it was more prevalent in other languages. For example instead of saying "if not <condition>" you can also say "unle
by m463 6y ago
I like the use of language in perl and wish it was more prevalent in other languages.
For example instead of saying "if not <condition>" you can also say "unless <condition>" which is more natural imo.
- hnick 6y agoYes it's a weird feature but I found myself drawn to it. Just like with natural language, sometimes the 'unless' keyword feels like a better fit. Both keywords work in postfix form, and this is how I usually use 'unless' so it reads more like a sentence. do_thing() unless ($a == 1); do_thing() if ($a != 1);
- Can_Not 6y agoThis is valid in crystal: unless a a = 4 end return x unless y return z