> given baz(@args) { return $_ when defined }
> given baz(@args) { return $_ when $_ > 0 }
Sweet.
Shouldn't the latter example be:
given baz(@args) { return $_ if $_ > 0 }
In general, if a C<when> condition clause contains
a C<$_>, chances are good that it's a mistake, right?
If a pipe short-circuited would one be able to do:
foo ==> baz; # do pipe iff foo is true
baz(@args) ==> return; # if LHS true, return it
?
(If you wanted a pipe to NOT short-circuit you would
have to use another pipe operator, say:
foo ==>> baz; # always do pipe
foo ===> baz; # many possible syntaces
The mnemonic would be that the shorter pipe does
short-circuiting. Or use an adverb:
foo ==> :always baz; # always do pipe)
--
ralph