[Bioperl-l] Small changes to some Annotation methods?

Jason Stajich jason at cgt.duhs.duke.edu
Tue Jan 20 16:00:16 EST 2004


That's a good things to fix.  You can also combine that into a single line
 return @{$self->{'_names'} || []};
and/or we should make sure
there is a
$self->{'_names'} = [];
in the initializer.

Although empty array is slightly different from the undef you are sending.
Depends on whether or not we want ot guarantee an array is sent back.

-jason
On Tue, 20 Jan 2004, Stefan Kirov wrote:

> Can we change the accessor methods, for example:
> sub each_gene_name{
>    my ($self, at args) = @_;
>
>    return @{$self->{'_names'}};
> }
>
> to
> sub each_gene_name{
>    my ($self, at args) = @_;
>    return undef unless ($self->{'_names'});
>    return @{$self->{'_names'}};
> }
> The current implementation will break the code if  return
> @{$self->{'_names'}} is empty.
> Jason, Heikki- I am asking just in case I am missing something....
>
> Stefan
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list