[Bioperl-l] Re: issues with _rearrange

Hilmar Lapp hlapp@gnf.org
Fri, 20 Sep 2002 10:48:45 -0700


On Friday, September 20, 2002, at 09:05 AM, Aaron J Mackey wrote:

>
> On Fri, 20 Sep 2002, Ewan Birney wrote:
>
>> Can I propose an
>>
>>   (F) - Write a specific constructor, called like:
>>
>>    $feature = 
>> Bio::SeqFeature::Generic->seqio_direct_new($start,$end,$tag_hash_ref);
>
> Certainly (this is another recasting of Matthew's actual idea, the 
> one I
> followed up on), and it's probably the easiest, "can do it right away"
> thing to do.
>

Yes, I've seen this in SeqFeature::Generic. I think what needs to be 
made absolutely clear and isn't yet is that you not call this method 
unless your name one of (SeqIO::xxxx, ...). Hence, starts with an 
underscore, no documentation that shows up in perldoc, etc.

> Just to argue once more for option E (optimizer), the advantage is that
> *every* call to _rearrange, no matter who/where/what get's 
> optimized away;
> no new speedy constructors needed.

What if you're running 5.6.x or below?

The following I'm sure is trivial and has been suggested by Aaron 
already I believe but what about mandating the convention that you 
put parameter names either as all-upper or all-lower case, and then 
the code

	sub XXXXX {
		my ($self,@args) = @_;
		my %params = @args;
		my $arg1 = $params{-arg1} || $params{-ARG1};
		....
	}

is still reasonably simple, is inlined, and is reasonably readable. 
The downside is parameters _have_ to be named. May or may not be 
acceptable.

	-hilmar
--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------