Karim BELABAS on Fri, 3 Sep 1999 18:17:13 +0200 (MET DST)


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

Re: Str() limitation


[Igor:]
> ? length(Str(10^4094))
> 0                            
> 
> Lurking around points to the following:
> 
> src/language/anal.c:
> #define TOTAL_STRING_ARG 4096 /* Total length of string args */
> 
> So my question is, what's the reasoning behind this limitation, and what
> are the consequences, if any, of lifting this limit?  Memory consideration?

Reasoning was that strings were of a very restricted type when this was
introduced (basically constant strings: "a", within print() statements, t_STR
didn't exist) [when Ilya rewrote the GP line parser using symbolic codes for
his Perl interface. This started version 1.900, which eventually led to
version 2.0].

Then arbitrary PARI objects were allowed to be automagically "stringified",
and the restriction became very dangerous without anybody noticing (my fault,
here). Anyway, it is and always was completely unnecessary; I reworked string
handling for 2.0.17 (forthcoming), removing all static limits in this area.
The code is simpler if slightly less efficient (since it applies mostly to
"print" statements, I don't consider this a problem).

  Karim.
__
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/