[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #15690] Refactor /MISSING subcommands.
From: |
John Darrington |
Subject: |
Re: [bug #15690] Refactor /MISSING subcommands. |
Date: |
Sat, 30 Sep 2006 08:45:22 +0800 |
User-agent: |
Mutt/1.5.4i |
On Wed, Sep 27, 2006 at 07:48:25AM -0700, Benjamin Levy Pfaff wrote:
Quoting John Darrington <address@hidden>:
> Well I'd kinda hoped that we could lift that responsibility from the
> programmer.
>
> Rank has 5 calls to casereader_read{_xfer}, each of which will have to
> be replaced by loops, which is error prone, and (IMHO) messy. Rank is
> not an isolated case either; t-test.q has 4 calls, 6 if you count the 2
> inside levene.c. However, in each call to casereader_read, the
> missing value semantics are going to be identical, so to me, it makes
> sense to store these semantics (or a pointer to them) in the
> casereader, and put the loop inside the function rather than outside.
OK. Then let's create a new abstract data type, a "case_filter" or some
such. To get a casereader with a filter, you pass one in, otherwise you
pass in a null pointer, so there's only a single additional argument.
Cloned casereaders keep the same filter. When no casereader or clone is
still using a filter, it gets destroyed; either reference counting or
case_filter cloning could be used.
That sounds good to me. I suppose the details of the case_filter can
be worked out as we discover new issues.
(I really want to avoid adding more
static data. I've been trying to reduce the amount we have for a long
time.)
I agree. I've been meaning to suggest that we do something about the
statics in src/data/procedure.c, but that's a discussion for another thread.
BTW, is RANK a good example of use for this? If I understand correctly,
RANK shouldn't actually drop cases with missing values, but just set their
ranks to missing values (is that right?). But because RANK contains a loop
that copies one casefile to another, a casereader that dropped missing
values would drop cases from the output.
You're right. Rank is probably simpler than I'd first thought with
respect to missing values.
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.
pgpZpujIUZlVG.pgp
Description: PGP signature