Karim BELABAS on Sat, 31 May 2003 20:15:37 +0200 (MEST)

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

Re: .gprc

On Thu, 14 Nov 2002, Ilya Zakharevich wrote:

[ ...sorry for answering this one so late... ]

> a) is it *necessary* to remove all the whitespace from the lines in
>    .gprc before processing?  Is not it fortran all over again?
>    [Try putting something like this there: #if stable foo=bar]

Well, not really necessary, but it certainly simplifies processing. At
least I can reuse the overall parsing engine. When the latter is eventually
replaced by the one from GP2c, all this will go anyway.

> b) It is very convenient to have #if VERSION; however, it is not
>    documented that this directive kills all but with the bleeding
>    edge GP/PARI.  It should be supported in the stable branch too to
>    become useful.  (Maybe it is the latest stable branches)

This has indeed been addressed in 2.1.5 (04/04/2003).

> c) Is it designed that an unrecognized line in .gprc kills GP/PARI?
>    Printing a warning and skipping it looks like more useful directive.

Good point. I just made startup errors non-fatal. When reading from GPRC,
this should simply discard the current line (and print
(rough approximation of) the offending line number). When reading from file
through GPRC 'read' statement, the full file is discarded (and filename

> d) It is possible to get an array [2,4,5] for GP/PARI version 2.4.5
>    from the GP/PARI API?  Then one could delegate version-dependent
>    processing to the read() directives...

It would clutter the name space, and I'm not sure this would really be
useful. Besides, there's the obvious

vers() =
  eval( Str("[",
          extern("gp --version-short 2>&1 |
              sed -e 's/\\./,/g' -e 's/^/\"/' -e 's/$/\"/'"),  "]") )

[ just kidding. It only gives the version of the first gp binary in path ]


Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]