Ilya Zakharevich on Fri, 19 Mar 2004 21:09:43 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Math::Pari and CVS version |
On Wed, Mar 17, 2004 at 08:32:15PM +0100, Karim Belabas wrote: > In all cases I can imagine, you simply don't need any of those parameters and > are happy with default values. > > static pariout_t out1 = { 'g', 0, -1, 1, f_RAW, 0 }; > void out(GEN x) { gen_output(x, &out1); } > > or possibly > > void out2(GEN x, char f, long d) { > pariout_t T = DFLT_OUTPUT; /* copy */ > T.format = f; > T.fieldw = d; T.sp = 0; > gen_output(x); > } > > That should emulate the old bruteall. > > Well, I probably lack imagination... > > Note: I just removed the (hackish, useless) 'initial' flag I had inserted > in the pariout_t struct. The above example assumes either 2.2.6 (no pariout_t > before), 2.2.7 or up to date CVS. Does it mean that the code in Math::Pari does not work any more? > >> I will probably document this. > > > > Restoring bruteall() may be an easier way to cover most important > > cases. ;-) > > I'd like to avoid that: it was a specialized function with many arguments, > but still lacking some flexibility, and ignoring defaults like current > realprecision. It looks easier to me to either use one of the straightforward > documented routines, or copy a completely customized output type as out1 > above. I do not see why insufficient flexibility is a problem. If one wants to use something more flexible, one can do it with pariout_t. If it had some bugs, can one rewrite it (like you did above), and export the new version based on gen_output()? Alternatives look like a complete mess due to APIs changing under one's feet... Thanks, Ilya