On Wed, Jan 31, 2007 at 07:10:13AM -0800, Ben Pfaff wrote:
John Darrington <[EMAIL PROTECTED]> writes:
> On Tue, Jan 30, 2007 at 10:30:43PM -0800, Ben Pfaff wrote:
>
> So I'm not proposing to
> encourage use of random access where it's not necessary.
>
> Would it therefore be worth having a flag passed to the casereader
> constructor which declares whether or not the casereader performs
> random access?
What's the intended usage?
Well I suppose it's similar to declaring a variable const. If we
have something similar to
struct casereader *sequential_reader = create_casereader (SEQUENTIAL);
or
struct casereader *random_reader = create_casereader (RANDOM);
and the implementation enforces sequential-only access unless random
is requested, then there may be two possible advantages:
1. By declaring a reader sequential, we can trap inadvertent random
access. In code reviews, any use of random readers is obvious,
and the reviewer may be able to suggest a faster method using
sequential access.
2. Maybe the implementation can make internal optimisations if it's been
passed the SEQUENTIAL flag?
Of course I don't know if this really fits in with your code. It's
just a suggestion.
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
_______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
