Karim BELABAS on Tue, 5 Nov 2002 19:54:12 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: lisseq0() problem? |
On Thu, 31 Oct 2002, Ilya Zakharevich wrote: > I see that lisseq0 assumes that it can do gerepileupto(). But if what > it reads is a function call, "f(whatever)", and f() is a wrapper for a > C function returning a GEN, the last stack-related operation is what this C function did. > > Essentially, lisseq0() assumes that any C function returning a GEN > returns the data in the same format as gcopy() [i.e., a recursive GEN > is the *last* chunk in the memory occupied by it and its kids]. Any C function, whose result can be returned as the output of an expression evaluation by the GP parser, yes. > Is this intentional? Yes. It is documented that install'ed functions returning a GEN should satisfy gerepileupto assumptions [see install() in index, p.190 in 2.2.5] Writing functions satisfying these assumptions is not a problem in practice [ either use high-level routines, or build your recursive objects via low-level access, and finish by gerepilecopy() ]. 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/