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

Stefan Kirov skirov at utk.edu
Tue Jan 20 17:05:50 EST 2004


Jason, thanks for the reply. But these are deprecated methods (as I 
noticed after I sent the message), so I don't know if it is really worth 
fixing the code. And yes, I think also empty array is better, that is 
what Annotation::Collection is doing.
Stefan



Jason Stajich wrote:

>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
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>  
>

-- 
Stefan Kirov, Ph.D.
University of Tennessee/Oak Ridge National Laboratory
1060 Commerce Park, Oak Ridge
TN 37830-8026
USA
tel +865 576 5120
fax +865 241 1965
e-mail: skirov at utk.edu
sao at ornl.gov



More information about the Bioperl-l mailing list