Karim BELABAS on Sun, 4 Aug 2002 14:23:53 +0200 (MEST)


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

.gprc + version number


Hi,

  I noticed that unrelated code rewrites [ filtre() and read_line_from_file() ]
had enabled multiline constructs [ {}, \ and = ] in .gprc (with a few minor
bugs which I ironed out). Since this looks useful, I documented it.

Second, I added a preprocessor test against PARI version number (using Bill's
patch introducing PARI_VERSION & friends) to the gprc capabilities. In short
the following is now valid _in the gprc file_:

  #if VERSION > 2.2.3
  {
    new_galois_format = 1; \\ default introduced in 2.2.4
    read "new_script"; \\ syntax errors in older GP
  }

[ this is all documented in the user's manual ]

It would be relatively painful to backport, this so I won't do it, but at
least it will be there from now on.

A few remarks:
1) it would be preferable (and trivial to implement) to have standard cpp
syntax (using pairs #if / #endif)  but that would introduce yet another
compatibility problem.

2) this could conceivably be useful under GP. Perhaps introducing the
following command would be enough:

   require(str) = raise an error if GP's version number is strictly lower
that str (which has the form "2.2.4", where the trailing components can be
omitted).

Comments ?

    Karim.
-- 
Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathematiques, Bat. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas/
--
PARI/GP Home Page: http://www.parigp-home.de/