[Bioperl-l] For CVS developers - potential pitfallwith "returnundef"
Hilmar Lapp
hlapp at gmx.net
Wed May 31 18:08:43 UTC 2006
On May 31, 2006, at 12:03 PM, Lincoln Stein wrote:
> If the subroutine is documented to return "false" on failure, then
> one must call
> return (or "return ()" ).
The problem seems to be that 'a value that evaluates to either true
or false' and 'a [meaningful] value or undef' and 'a value or
false' ('a value or no value) are not the same in perl. And what
would/should one expect if the doc states 'true on success and false
otherwise'?
Maybe the documentation should also be fixed to avoid any ambiguity.
I.e., avoid documenting 'a value or false' because it may be
ambiguous (not only) to the less proficient. 'True or false' should
imply a value being returned.
Comments?
-hilmar
--
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at gmx dot net :
===========================================================
More information about the Bioperl-l
mailing list