pspp-dev
[Top][All Lists]
Advanced

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

Re: [patch #5491] Eliminated global variable current_dataset


From: Ben Pfaff
Subject: Re: [patch #5491] Eliminated global variable current_dataset
Date: Wed, 25 Oct 2006 22:15:46 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> As you can see, I had to disable the assertion in evaluate.c, as
> several tests triggered it.  Nothing untoward happens when I comment
> it out.  Comments?

I didn't notice that until now.  Thanks to pointing it out.

Here's the assertion that got commented out:
        assert ((c != NULL) == (e->dict != NULL));

It's there because you can create an expression that references a
dictionary (dataset) or one that doesn't.  Without a
dictionary/dataset, the expression can't refer to variables, and
you don't need to specify a case when you evaluate the
expression.  With a dictionary/dataset, the expression can refer
to variables, so you must specify a case when you evaluate the
expression.  The assertion enforces that invariant.  (And maybe
it could use a comment, as could expr_create.)

I think it should be changed to:
        assert ((c != NULL) == (e->ds != NULL));
-- 
Positronic Functional Android Fabricated for Fighting




reply via email to

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