How to find out runtime version of Maxima? (confused by new format of eigenvectors() in 5.19.2)



On Fri, Sep 4, 2009 at 13:20, Andrej Vodopivec
<andrej.vodopivec at gmail.com> wrote:
> Lisp variable *autoconf-version* contains the version as a string. You
> can then use stringproc functions to compare versions.
>
> (%i1) version: ?\*autoconf\-version\*;
> (%o1) 5.19.2

Thanks, this worked! :)

I've come up with the following:

maxima_version() :=
  map(parse_string, tokens(?\*autoconf\-version\*, 'digitcharp));

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);

Check version like this:

if version_compare(maxima_version(), [5,19,2]) >= 0 then ...

Just wonder if there's a simpler, cleaner way to do this?

--
Cheers,
Alex