Gottfried Helms on Fri, 13 Jan 2023 17:36:21 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Programmatically obtain a complete list of commands and keywords for updating the PARI/GP third-party IDE tools.


Am 10.01.2023 um 01:46 schrieb Hongyi Zhao:
> Hi here,
> 
> I'm not sure whether there is an elegant way in PARI/GP, which can let
> me programmatically obtain a complete list of commands and keywords
> for updating the PARI/GP third-party IDE tools, such as pari-gp-lang
> [1].
> 
> Any tips would be appreciated.
> 
> [1] https://github.com/DavidAyotte/pari-gp-lang/issues/3
> 
> Regards,
> Zhao
> 
Hmm, don't know whether such a thing is meant:

- - - - - - - - - - - -

I've a small set of subroutines which provide from
a new version of GP the commands plus simple helptext
("?Euler") as a text file like this:
============================================================================
Catalan=Catalan(): Catalan's number with current precision.
Col(x, {n}): transforms the object x into a column vector of dimension n.
Colrev(x, {n}): transforms the object x into a column vector of dimension n in  reverse order with respect to Col(x, {n}). Empty vector if x is omitted.
Euler=Euler(): Euler's constant with current precision.
I=I(): square root of -1.
List({x=[]}): transforms the vector or list x into a list. Empty list if x is  omitted.
...
znorder(x,{o}): order of the integermod x in (Z/nZ)*. Optional o represents a  multiple of the order of the element.
znprimroot(n): returns a primitive root of n when it exists.
znstar(n,{flag=0}): 3-component vector v = [no,cyc0,gen], giving the structure  of the abelian group (Z/nZ)^*; no is the order (i.e. eulerphi(n)), cyc is a  vector of cyclic components, and gen is a vector giving the corresponding  generators.
============================================================================
To use this I've constructed a small set of stringfunctions,
such that I can search for a substring (as keyword/keyphrase
in the helptext or as textelement in the commandnames, using
the Pari/GP-dialog.

The creation of the textfile is not so elegant as shown here
using grep; I'm using dos-batch and currently a small tool in
 Delphi (but that should be doable with the GP-stringfunctions
now). It is currently only for my own need, so no documentation
and ad-hoc creation of the list after new Pari/GP-version is
not much refined.
Moreover, if I have the air to push this further (to compare
GP-versions, include an update-protocol in some meaningful way
...) that would be the next step.

- - - - - - - -

If something like this was adressed in the question and
that approach is interesting I could go to streamline things
more and make it available to the community.

Gottfried