Bill Allombert on Sat, 17 Jul 2004 17:28:30 +0200


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

Re: How to get a variables name


On Mon, Jul 12, 2004 at 10:44:39PM +0200, Stefan Harwarth wrote:
> Hello,
> I'm relativly new to PARI and need to fetch the name of a variable from the
> "variable number" (something like a reverse fetch_user_var()) in library
> mode.
> 
> In the User Manual in chapter 4.6.1 I found nothing useful except the
> reference to the field varentries[] and after a short glance into the code
> the struct-member "name", but since it is not in the documentation, I fear
> that it might change in the future.

Probably the best way is to use something like

char *namevar(long v) { return GENtostr(polx[v]); }

> Is there any documented function for this task?

Probably none, since variables names are a GP language only concept,
they have no real effect for libpari programs outside display.

Cheers,
Bill.