On Mon, 28 Jul 2008, Sven Schreiber wrote:
Am 24.07.2008 14:02, Allin Cottrell schrieb:
> On Thu, 24 Jul 2008, Riccardo (Jack) Lucchetti wrote:
> >
> > This solution will take care of [the main problems we have
> > identified]; its disadvantages are:
> >
> > i) it won't be possible to modify the series referenced by a
> > list via a function...
>
> Quite correct, as per current CVS...
IMO it's not a big problem (although in principle I can imagine
cases where it could be inconvenient)... Having said that, maybe
in the (distant) future the implementation of the "list"
datatype can be refined in a way that all those things become
possible.
Yes, that could be done eventually.
On the $-accessor for the gretl version number, I wrote:
> I tend to favour the simple variant: "1.7.6" ->
1.76, i.e.
> collapse the three numbers in the gretl version string to a
> single floating-point value... The more rigorous alternative
> would be to define 3 values, traditionally referred to as
> major_version, minor_version and patchlevel. But I find that
> a pain to work with.
Sven says:
But isn't the 3-value solution already used in function
packages? ("This package requires at least gretl version x.x.x")
It seems to me that the same policy should apply to both areas.
We have to distinguish (a) what's shown to the ordinary user and
(b) the internal representation of the version number, which is
used for checking whether a given instance of gretl is
sufficiently up-to-date to do something or other (and which, I
think, should be provided as the value of $version).
It's true, in the GUI package editor we use "x.y.z", as in the
About dialog, on the website, and so on. However, when comparing
version numbers internally we map x.y.z onto a single value. My
first suggestion above was not so good. We now have a better
mapping -- it's described in the function help for $version, but
here's the idea:
$version = 10000 * x + 100 * y + z
E.g. "1.7.6" -> 10706
"1.6.0" -> 10600
This will give a "correct" result (higher integer version number =
more recent build) for "x.y.z" with up to two digits for y and/or
z, e.g. "1.12.13". (It seemed to me that we _might_ at some point
want minor version numbers and patchlevels > 9, though surely not
greater than 99.)
If we didn't do this sort of mapping, then to test if (say) the
gretl version is < 1.7.7 you'd have to do something like the
following:
if ($ver_x == 1 && ($ver_y < 7 || ($ver_y == 7 && $ver_z < 7)))
rather than "if $version < 10707".
Allin.