Loïc Grenié on Tue, 15 Oct 2024 08:15:38 +0200


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

Re: file collisions and gp2c-run command




Le mar. 15 oct. 2024 à 04:14, American Citizen <website.reader3@gmail.com> a écrit :
Suppose I have 3 pari packages

nlog(A) = {do stuff, return;}
{ pkg1(A)=

\r nlog(A);

do stuff;

}

{pkg2(B)=

\r nlog(A);

do stuff;

}

{pkg3(C)=

\r pkg1;

\r pkg2;

do more stuff;

}

when I run the gp2c-run command on pkg, it thinks I am redefining nlog
all over again and flags it as a warning.

     Do it like this:

File nlog.gp:

nlog(A) = {do stuff, return;}

File pkg1.gp:
\r nlog
{ pkg1(A)=

do stuff;

}

File pkg2.gp:
\r nlog
{pkg2(B)=

do stuff;

}

File pkg3.gp:
\r pkg1
\r pkg2
{pkg3(C)=

do more stuff;

}

    You will read nlog.gp at most twice. You can also not read nlog in neither
  pkg1 nor pkg2, and read it beforehand in pkg3 (in that case pkg1 and pkg2
  will not be closed, but you will not have the repetition of the definition).

      Loïc