[Bioperl-l] Re: Bio::Root::Root::new()

Heikki Lehvaslaiho heikki@ebi.ac.uk
10 Dec 2002 17:28:03 +0000


On Mon, 2002-12-09 at 18:04, Hilmar Lapp wrote:
> -verbose isn't that important, I just thought it's a good idea to 
> try to rescue it because sometimes parent classes might add a 
> -verbose flag when the descendant class only passes a single 
> argument or so.
> 
> I don't think we should throw() here -- there are some classes which 
> accept unnamed parameters, which makes sense if there can only be a 
> single parameter for instance. If we decide to throw upon uneven 
> number of arguments, at the very least I'd have to go over a whole 
> bunch of older bioperl-db classes, and I'm not convinced this is 
> worth the effort.

I did not know that we had any unnamed parameters in BioPerl, hopefully
not in core bioperl-live. 

I ran into this problem when a comma was missing from an SQL statement
and I got back an odd number of arguments and it was not the Root but
the storage objects that started complaining of strange values.
To me it sounds natural that the root argument processing methods would
check this, but if you think it it too much work, we can leave it as it
it is and re-evaluate the situation after 1.2.

	-Heikki


> 	-hilmar
> 
> On Monday, December 9, 2002, at 05:57 AM, Heikki Lehvaslaiho wrote:
> 
> >
> > Hi Hilmar,
> >
> > You fixed the Root new method three weeks ago. Now if an odd number of
> > arguments is passed to the constructor, it does not complain but tries
> > to set verbose() on. I do not understand why verbose is important?
> > Wouldn't it make more sense to throw?
> >
> >   shift if @_ % 2;
> >   =>
> >   $self->throw("Uneven number of arguments ". join(", ") @_) if @_ $ 2;
> >
> > 	-Heikki
> >
> > --
> > ______ _/      _/_____________________________________________________
> >       _/      _/                      http://www.ebi.ac.uk/mutations/
> >      _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
> >     _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
> >    _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
> >   _/  _/  _/  Cambs. CB10 1SD, United Kingdom
> >      _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
> > ___ _/_/_/_/_/________________________________________________________
> >
> >
> --
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp at gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________