[Bioperl-l] For CVS developers - potential pitfallwith"returnundef"
Chris Fields
cjfields at uiuc.edu
Wed May 31 20:40:19 UTC 2006
What about modules that have 'throw_not_implemented' statements present?
Here's a list with the total for each. Some of these are interfaces (I got
rid of a number that ended in 'I' or 'IO' to remove the I/IO interfaces but
it misses a few). There are a number here that are implementations, though
(Bio::AlignIO::maf, Bio::Restriction:IO::*), so they are technically
incomplete:
Instances: 1 Module : Bio::AlignIO::maf
Instances: 25 Module : Bio::Assembly::Contig
Instances: 2 Module : Bio::Assembly::ContigAnalysis
Instances: 2 Module : Bio::Biblio::BiblioBase
Instances: 4 Module : Bio::DB::Expression
Instances: 2 Module : Bio::DB::Expression::geo
Instances: 5 Module : Bio::DB::Flat
Instances: 2 Module : Bio::DB::Query::WebQuery
Instances: 17 Module : Bio::DB::SeqFeature::Store
Instances: 2 Module : Bio::DB::SeqVersion
Instances: 3 Module : Bio::DB::Taxonomy
Instances: 1 Module : Bio::FeatureIO::bed
Instances: 1 Module : Bio::Map::Marker
Instances: 1 Module : Bio::MapIO::fpc
Instances: 1 Module : Bio::MapIO::mapmaker
Instances: 1 Module : Bio::Restriction::IO::bairoch
Instances: 1 Module : Bio::Restriction::IO::itype2
Instances: 1 Module : Bio::Restriction::IO::withrefm
Instances: 1 Module : Bio::Tools::Analysis::SimpleAnalysisBase
Instances: 3 Module : Bio::Tools::Run::WrapperBase
Chris
> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Lincoln Stein
> Sent: Wednesday, May 31, 2006 1:15 PM
> To: Hilmar Lapp
> Cc: bioperl-l at lists.open-bio.org; Heikki Lehvaslaiho
> Subject: Re: [Bioperl-l] For CVS developers - potential
> pitfallwith"returnundef"
>
> If the documentation says "returns false" then I expect to be able to do
> this:
>
> @result = foo();
> die "foo() failed" unless @result;
>
> If the documentation says "returns undef" then I expect this:
>
> @result = foo();
> die "foo() failed" unless $result[0];
>
> Lincoln
>
>
> On Wednesday 31 May 2006 14:08, Hilmar Lapp wrote:
> > 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
>
> --
> Lincoln D. Stein
> Cold Spring Harbor Laboratory
> 1 Bungtown Road
> Cold Spring Harbor, NY 11724
> (516) 367-8380 (voice)
> (516) 367-8389 (fax)
> FOR URGENT MESSAGES & SCHEDULING,
> PLEASE CONTACT MY ASSISTANT,
> SANDRA MICHELSEN, AT michelse at cshl.edu
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list