[Bioperl-l] For CVS developers - potential pitfallwith"returnundef"

Lincoln Stein lstein at cshl.edu
Wed May 31 21:07:06 UTC 2006


> Instances: 17	Module : Bio::DB::SeqFeature::Store

This is intentional. Bio::DB::SeqFeature::Store is intended to be a virtual 
base class. The throw_not_implemented() calls are there to force developers 
to override the needed interface methods.

If this is not the right way to do it, let me know and I'll fix it.

Lincoln


> 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

-- 
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



More information about the Bioperl-l mailing list