John Darrington <[EMAIL PROTECTED]> writes:

> But that's largely a guess, since I'm not entirely sure what
> proc_commit does, nor what the states PROC_{OPEN,CLOSED,COMMITTED}
> actually mean.
>
> Ben, do you have the time to write a brief explaination?

PROC_COMMITTED: no procedure is in progress and the active file
is not being read.

PROC_OPEN: proc_open() has been called to obtain a casereader for
the active file and that casereader has not been closed.

PROC_CLOSED: the casereader obtained from proc_open() has been
closed with casereader_destroy(), but the procedure is not
complete because proc_commit() has not been called.

Transitions:
        PROC_COMMITTED -> PROC_OPEN via proc_open.
        PROC_OPEN -> PROC_CLOSED via casereader_destroy on the
                casereader returned by proc_open.
        PROC_CLOSED -> PROC_COMMITTED via proc_commit.
        No other transitions are allowed.

An early draft didn't have the CLOSED state, so that destroying
the casereader from proc_open committed the procedure, but this
was too difficult to deal with because quite often there was no
natural connection between destroying the casereader and
committing the procedure.
-- 
"Premature optimization is the root of all evil."
--D. E. Knuth, "Structured Programming with go to Statements"


_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to