Karim BELABAS on Mon, 22 Nov 1999 15:47:51 +0100 (MET)

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

Re: Turning a sequence of expr into expr

> [Bill:]
>> ? ?ploth
>> ploth(X=a,b,expr,{flags=0},{n=0}):
>>             ^^^^
>> ? ?for
>> for(X=a,b,seq):
>>           ^^^
>> Only true control statements handle seq ,if,forxxx, while,until
>> but not sumxxx,prodx,solve,intnum etc..
> Then this should be marked in the "prototype", and the parser should
> emit a syntax error in such a situation.  The simplest way to do it is
> to make lisexpr() to die if it finds ';' at the end, and make lisseq()
> use a clone lisexpr_seqok() instead.

I introduced a new parser code for the function "prototypes" (from GP point
of view). Namely 'E' for an argument which is a single expression (read by
lisexpr()). 'I' remains the same and accepts a sequence of statements.
All genuine control statements + the constructors (vector/matrix) accept a
seq. All others expect an expr. [ I believe I have correctly updated the
numeric code for Math::Pari ]


P.S: 2.0.18 is forthcoming, so no patches. The CVS repository is up-to-date,
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
PARI/GP Home Page: http://hasse.mathematik.tu-muenchen.de/ntsw/pari/