error trying to build de documentation



I have spent a bit of time re-writing build_index.pl in lisp.
I have a  functional version that appears to work  independent
of the encoding.

I think that there are several advantages to having the help index
built in lisp:
-as mentioned, this avoids encoding issues because the index can
be built at runtime;
-the present code can accomodate several master info files, which
would allow a usser to add documentation, including 3rd party
documentation at runtime;
-the code runs in about 2sec on a netbook+sbcl, so it is practical
to build the index on demand (e.g. when the first help query is made).

Here's the cost: it's written with the cl-ppcre regex library that
provides most Perl regexes for CL. Personally, I think that it 
is worth adding this to the Maxima code base, because nregex is,
well, pretty primitive.

Adding cl-ppcre would also allow better/more focused info queries,
which I would be happy to add.

Summary:
The code is here:
http://www.maths.ed.ac.uk/~lbutler/build-index.lisp
Please try it out and give me some feedback.

Leo


== examples ==

work at squeeeze:$ ~/maxima/sandbox/maxima/maxima-local -p
~/maxima/scripts/maxima-lang-subdir-es.lisp  --init=/dev/null
(%i1) load("../build-index.lisp");
; loading system definition from
/usr/share/common-lisp/systems/cl-ppcre.asd into #<PACKAGE ASDF0>
; registering #<SYSTEM :CL-PPCRE> as CL-PPCRE
; registering #<SYSTEM :CL-PPCRE-TEST> as CL-PPCRE-TEST
0 errors, 0 warnings
(%o1)                         ../build-index.lisp
(%i2) ? expand

 -- Funci?n: expand (<expr>)
 -- Funci?n: expand (<expr>, <p>, <n>)
     Expande la expresi?n <expr>. Los productos de sumas y de sumas con
     exponentes se multiplican, los numeradores de las expresiones
     racionales que son sumas se separan en sus respectivos t?rminos, y
     las multiplicaciones (tanto las que son conmutativas como las que
     no) se distribuyen sobre las sumas en todos los niveles de <expr>.


o<snip>

     Vuelve a simplificar una expresi?n pero sin expansi?n:

          (%i7) expr:(1+x)^2*sin(x);
                                                 2
          (%o7)                           (x + 1)  sin(x)
          (%i8) exponentialize:true;
          (%o8)                                true
          (%i9) expand(expr,0,0);
                                             2    %i x     - %i x
                                   %i (x + 1)  (%e     - %e      )
          (%o9)                  - -------------------------------
                                                  2


  There are also some inexact matches for `expand'.
  Try `?? expand' to see them.


====
work at squeeeze:$ ~/maxima/sandbox/maxima/maxima-local -p
~/maxima/scripts/maxima-lang-subdir-de.lisp  --init=/dev/null
(%i1) load("../build-index.lisp");
; loading system definition from
/usr/share/common-lisp/systems/cl-ppcre.asd into #<PACKAGE ASDF0>
; registering #<SYSTEM :CL-PPCRE> as CL-PPCRE
; registering #<SYSTEM :CL-PPCRE-TEST> as CL-PPCRE-TEST
0 errors, 0 warnings
(%o1)                         ../build-index.lisp
(%i2) ? expand

 -- Funktion: expand (<expr>)
 -- Funktion: expand (<expr>, <p>, <n>)
     Expandiert den Ausdruck <expr>. Produkte von Summen und Potenzen
     von Summen werden ausmultipliziert. Die Nenner von rationalen
     Ausdr?cken, die Summen sind, werden in ihre Terme aufgespalten.
     Produkte (kommutative und nicht-kommutative) werden in Summen
     herein multipliziert.

 
-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.