Re: Sequence Routines

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message ----- 
From: "Pete Lomax" <petelomax at blueyonder.co.uk>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Sequence Routines


> 
> 
> On Thu, 18 Sep 2003 19:50:50 +1000, Derek Parnell
> <ddparnell at bigpond.com> wrote:
> 
> >-- remove_right
> >--      (sequence pSource, integer pHowMany)
> etc.
> 
> Hi Derek,
> I've had a look at those routines and would make one observation:
> There's far too much bounds correcting going on. To my mind, if the
> calling program asks to remove 87 items from a list of 3, it should
> fail with an error there and then. At least during development, there
> might be some argument for turning it back on for released code.

At least with open source like this you can 'fix' it to your personal tastes.
 
> Your post triggered me to start writing a gp sequence manipulation
> routine. It _will_ sacrifice performance for flexibility, so it may
> not interest you. However, if you still have some test cases lying
> around from that code, can you mail them to me, thanks.

Sorry, I deleted the test code. There were almost two hundred different test
cases too!
 
> Below is the first draft, which handles 12 of your routines (as I
> said, probably far too slowly), not the find and match extensions.
> It is also written with a bit of negative index handling.

It may be a bit slow but the main issue I see is that its obsure. Hard to read.
But that's just me; no matter.

-- 
Derek

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu