pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: casefile random access


From: Ben Pfaff
Subject: Re: casefile random access
Date: Thu, 08 Jun 2006 18:22:13 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> On Thu, Jun 08, 2006 at 09:47:36AM -0700, Ben Pfaff wrote:
>      John Darrington <address@hidden> writes:
>      
>      > Another problem I've encountered:  I'm getting this assertion in
>      > casefile_append : 
>      >
>      >  assert (cf->mode == WRITE);
>      >
>      > Would it not be appropriate to allow write-after-read for random
>      > casereaders ?
>      
>      It should be possible, although I'll note that writing is not
>      associated with a casereader.
>
> I mean't that would it be acceptable if casefile_get_random_reader
> didn't put the casefile into READ mode ?

Ah, yes, probably.

>      I'm beginning to believe that casefiles should not be used for
>      GUI access.  Instead, we should create a new, more dynamic
>      structure for GUI access, one that supports the casefile
>      operations.  For convenience, I'll call it a "flexfile", because
>      it's flexible.  The GUI would use flexfiles where the TUI uses
>      casefiles.  I'd write a wrapper that allowed them to be used
>      interchangeably.
>
> Rather than a wrapper, how about an inheritance mechanism?  So that a
> flexifile inherits from a casefile, and can do everything a casefile
> can and more. Or perhaps have them both implementing a common abstract
> data type.  It might be easier to use that way.

Yes, one of those is really what I meant.

> In the mean time, I've just commented out that assertion in
> casefile_append, and so far, haven't noticed any untoward consequences.

It's probably OK.  I think I meant it as a policy enforcement
mechanism, not as a guard against internal consistency.
-- 
"In this world that Hugh Heffner had made,
 he alone seemed forever bunnyless."
--John D. MacDonald




reply via email to

[Prev in Thread] Current Thread [Next in Thread]