Package: pari-stable
Version: 2.7.2 and probably others
In section 2.9.3 of the user's guide, the following function is defined:
histlast(n) = vector(n, i, eval(Str("%", %#-i+1)))
which does not work as described (or at all, really). For example, I get
*** at top-level: histlast(2)
*** ^-----------
*** in function histlast: vector(n,i,eval(Str("%",%#-i+1)
*** ^--------------------
*** in function eval: %-1
*** ^--
*** _-_: forbidden addition t_INT + t_CLOSURE.
*** Break loop: type 'break' to go back to GP prompt
when the previous history entry was a t_CLOSURE. (It's interpreting "%-1" as subtracting 1 from the last history entry, rather than the history entry number -1.)
I'm not sure if there's a way to do what the script is doing, or if the example should simply be removed. The documentation itself dates from 2005:
http://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=commit;h=4097d00e17d5ccd674bf61043c8317084487dc1b
I have not tried to dig up old copies of gp to see when this actually broke (or if it ever worked, for that matter).
Charles Greathouse
Analyst/Programmer
Case Western Reserve University