Bill Allombert on Tue, 28 Nov 2023 10:08:42 +0100


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

Re: trying to find a simple command to list all global variables


On Tue, Nov 28, 2023 at 09:27:13AM +0100, Karim Belabas wrote:
> * Bill Allombert [2023-11-28 09:19]:
> > On Mon, Nov 27, 2023 at 04:24:10PM -0800, American Citizen wrote:
> > > Hello:
> > > 
> > > I used the Okular search feature to step through the 675 page document
> > > "https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.15.4/users.pdf"; to see
> > > if a command to list the global variables on the stack or heap is available.
> > > 
> > > Nothing turned up that I can see (I did the scan twice)
> > > 
> > > So how do you find what variables have become global?
> > 
> > You can do 
> > \uv
> > (x and y are always global).
> > 
> > but you can use gp2c -W which will tell you where a global variable appears.
> 
> A final possibility is variables().

Note that variables() only returns polynomial indeterminates, not GP variables,
and since creating a GP variable no more automatically create the corresponding
formal indeterminates, this is missing most GP variables.

Cheers,
Bill.