Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Avoid Null Checks by Replacing Finders with Tellers. Parent comment
However this only gets topicalised in bare for & while but not if.
So you could do...
for (something_exists) { do_something_to($_); }
More common approach I've seen in Perl (and other languages where variable declarations return its value) is this:
if (my $it = something_exists) { do_something_to($it); }
There are no comments on this comment yet.
However this only gets topicalised in bare for & while but not if.
So you could do...
... as long as something_exists doesn't return a list :)More common approach I've seen in Perl (and other languages where variable declarations return its value) is this: