Bill Allombert on Thu, 11 Aug 2005 15:17:58 +0200


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

Re: output format


On Mon, Aug 08, 2005 at 12:03:37PM -0400, Igor Schein wrote:
> Hi,
> 
> Sometimes when I type, for example, factor(360), I'd like to see
> 
> 2^3 * 3^2 * 5
> 
> I wrote my own function to do that, but I think it'd be useful to
> enable users to see output in this format at some value of
> default(output).  Recalling my work with Mathematica, this is called
> an input format, i.e. something pastable back to gp as input.  So
> maybe there should be a new value of default(output) specifically for
> input format?

That will not work because the output routine wok on PARI object and
there is no way to tell a PARI object was build with factor or with
matrix(), or explicitly with [...;...]

What I have proposed in the past:

1) wrote a set of helper functions that display PARI objects nicely

2) tags PARI objects so we can know what they mean and what helper
function to call to display them.

1. can be implemented independently of 2., we just need to write a 
function help_fact() that display a factorisation matrix nicely
(as you did), help_nf() that does the same for a nfinit, etc.

Cheers,
Bill.