[Top][All Lists]

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


From: Ben Pfaff
Subject: Re: ADD FILES and UPDATE
Date: Tue, 02 Dec 2008 20:32:51 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Sun, Nov 30, 2008 at 09:00:56PM -0800, Ben Pfaff wrote:
>              * src/language/stats/freq.c (compare_freq): The main user
>                of this function is FREQUENCIES, and it intentionally
>                only analyzes the short-string part of long string
>                variables.  chisquare.c also uses it, and I don't know
>                whether it has the same intention.
> Is there any reason (other than spss emulation) to analyse only the
> the shortened part?

The only reason is simplicity.  Code that supports numeric and
short string data can just allocate a single "union value" for
each data item.  That makes life so easy: you can declare a
"union value" on the stack; you can declare an array of them and
index easily, and so on.

Code that also supports long string data has to work harder,
because a single logical data item has to be allocated as an
array, just to support the rare case where the data is a long
string variable.  You then have to, usually, dynamically allocate
each individual data item, because there's no way to predict at
compile time how much space it will take up: it might be 8 bytes
or 32767 bytes.  Life is harder, and it takes more care to write
the code.

So, we can "fix" this and related problems, but it's not as
simple as just flipping a switch and allowing long string
variables too.

>              * src/ui/gui/find-dialog.c (value_compare): Seems likely
>                to be wrong.
> It's wrong.

OK, for this do you want to prepare a patch or shall I propose
Ben Pfaff

reply via email to

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