Bioperl-guts: Re: Bioperl: 0.05 pre release

Ian Korf ikorf@sapiens.wustl.edu
Tue, 23 Mar 1999 10:19:50 -0600 (CST)


My take on returning an object or string:

I'm in favor of #2, return an object. For those who want a string, I suggest
we overload the "" operators to return the sequence as a string. Interpolation
in double quotes is pretty standard so it follows quite naturally that:

# use overload '""' => 'asString';       # in appropriate package(s)

$prot_obj = $seq->reverse->translate;    # returns object
$prot_str = "$seq->reverse->translate";  # object converted to string
print ">foo\n$prot_obj\n";               # simple FASTA output too

I'm generally opposed to overuse of overloading, but I think this is a very
good use of it. It was suggested in Lincoln Stein's DDJ draft he passed by
use some time ago.


-Ian
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl-guts.html
====================================================================