On 12/9/10 4:47 PM, Leo Butler wrote:
> < That is a little slow. Way back when with the old cl-info code, a 300
> < MHz machine with clisp could get entries in under a second. Fast
> < enough that no one really cared.
>
> Well, the notebook was running on battery. On an old T43
> (1.8GHz), loading the source file is so fast that I thought at first
> there must be some hiccup and the code was not being executed.
I will try this on the slowest machine I have access to and see how it
goes. But build-index.lisp only needs to be run once, right, at build
time? Then the slow times aren't so bothersome because it already takes
a long time to build maxima.
I like having build-index in lisp since I know lisp and don't know perl.
:-) Having cl-ppcre is quite nice too. I have no objections on it
being included. There might be a license issue, though, since it's a
BSD-license and maxima is GPL. I don't know if the GPL license virus
will affect cl-ppcre if it's included in maxima. I think it would be
hard to say we're merely conglomerating cl-ppcre with maxima. We could
probably ask the author about it if it's a problem.
>
> One final thing: the cl-info code is using hashes, my code uses alists.
> I didn't notice this til I moved to a different machine running a
> different lisp. It appears that Lisps handle the existence of hashes vs.
> alists differently. In case you are seeing gibberish, I have included
> patched search functions at
I was running into a problem that ? starting signaling errors. My
solution was to run :lisp (cl-info::load-info-hashtables) to create the
necessary hash tables. This worked. The output, however, is a bit off.
The documentation for ? additive is correct, but includes some
extraneous junk at the end for the German translation. Don't know where
that comes from, yet.
For ? expand, I get the info for expand, but I also get the info for
exp. That's just weird.
A couple of comments on the code.
I think some of the defparameters should really be defvars, especially
*maxima-info*.
In a couple of places you have with-open-file :element-type
'unsigned-byte. You probably want an element-type of (unsigned-byte 8).
Similarly, near those places, you create an array of element-type
'unsigned-byte. That should probably be '(unsigned-byte 8).
In a few places you use append to append to a list. That usually
converts what would be an O(n) algorithm to order O(n^2). Don't know if
that matters here or not. It's a (large) fraction of a second on my
2GHz mac, when build-index is loaded after it has been compiled.
I like this approach, especially if it allows us to add other info files
that might be supplied by share packages. That would be way cool. It
seems the old cl-info package had some support for this, but I've never
used it.
Ray