Karim Belabas on Fri, 04 Jun 2010 00:06:28 +0200


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

Re: PARI string input


* Sam Steingold [2010-06-03 22:56]:
> what's the difference between
> GEN readseq(char *t);
> and
> GEN gp_read_str(char *t);
> which one should I use?
> should I strip whitespace myself before calling them?

Short answer : use gp_read_str(), and don't worry about whitespace.

(23:04) gp > ??Input@4   \\ in current 'testing' branch.
Input:

   For input, PARI provides a powerful high level function which enables you to
input your objects as if you were under gp.   In fact, it is essentially the GP
syntactical  parser,   hence  you  can use it not only for input but for (most)
computations that you can do under gp. It has the following syntax:

   GEN gp_read_str(const char *s)

   Note that gp's metacommands are not recognized.

  Note. The obsolete form

   GEN readseq(char *t)

   still  exists  for backward compatibility  (assumes filtered input,  without
spaces or comments). Don't use it.


Cheers,


    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`