Jacques Gélinas on Tue, 19 May 2020 19:37:54 +0200


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

Globals and GP2C


How can I convince GP2C to accept globals like GP does ?

======================= file glob.gp
[A,B]
rst() = {      \\ reset global vars
  A = 2020; B = "virus"; return();
}
infoglob() = { \\ print global vars
  print("A = ", A, " B = ", B);
}
=======================
Two commands with results (weird version mismatch ?):
# gp2c -v
GP to C compiler version 0.0.11pl3
   targeted at PARI/GP 2.12.0 (DEVELOPMENT VERSION)   

# gp2c-run glob.gp
Reading GPRC: /home/Jacques/.gprc
        GP/PARI CALCULATOR Version 2.12.1 (development 25169-c8ee522b6)
         amd64 running cygwin (x86-64/GMP-6.1.2 kernel) 64-bit version

$ init_glob()
$ rst()
$ infoglob()
A = 2449958197289549828 B = virus

Jacques Gélinas

Blague: "Est-ce qu’on peut désinstaller et réinstaller 2020? Je pense qu’il y a un virus."