How to find out runtime version of Maxima? (confused by new format of eigenvectors() in 5.19.2)
Subject: How to find out runtime version of Maxima? (confused by new format of eigenvectors() in 5.19.2)
From: Stavros Macrakis
Date: Wed, 16 Sep 2009 13:11:21 -0400
orderlessp does the right thing with lists (lexicographic comparison),
but not the right thing with numbers represented as strings:
orderlessp(["1","10"], ["1","9"]) => true
By the way, "is" does not use lexicographic order:
is([1,2]<[2,3]) => unknown
This is probably appropriate, since in many of the uses of lists (e.g.
vectors), there is no well-defined order.
On the other hand, "is" fails with an internal error (which is never
appropriate) when applied to strings:
is("1"<"2")
Maxima encountered a Lisp error:
Error in PROGN [or a callee]: Caught fatal error [memory may be damaged]
Or maybe this has been fixed since 5.17.1/GCL/Windows?
-s
On Wed, Sep 16, 2009 at 12:54 PM, Robert Dodier <robert.dodier at gmail.com> wrote:
> On 9/16/09, Alexander Shulgin <alex.shulgin at gmail.com> wrote:
>
>> maxima_version() :=
>> ? map(parse_string, tokens(?\*autoconf\-version\*, 'digitcharp));
>
> Maybe this can be simplified somewhat.
>
> split (?\*autoconf\-version\*, ".");
> ?=> ["5","19","2"]
>
> Note that the result of split is a list of strings.
> Incidentally it's not guaranteed that each element is just
> a number --- there have been (and there continue to be)
> version numbers which are numbers & letters combined.
>
>> version_compare(v1, v2) := block(
>> ? [len1: length(v1), len2: length(v2), v, i, cmp: 0],
>> ? if len2 > len1 then v1: append(v1, makelist(0, i, 1, len2 - len1)),
>> ? if len1 > len2 then v2: append(v2, makelist(0, i, 1, len1 - len2)),
>> ? v: v1 - v2,
>> ? i: 1,
>> ? while i <= length(v) and cmp = 0 do
>> ? ? (cmp: v[i],
>> ? ? ?i: i + 1),
>> ? cmp);
>>
>
> A custom comparison function isn't necessary.
> orderlessp does the right thing with lists.
>
> orderlessp (["5", "19", "1"], ["5", "19", "2"]);
> ?=> true
>
> HTH
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>