RE: Re: Outputting S-expressions
"Page, Bill" <[email protected]>
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Message-ID | <CAE9B164E720CE4D8727792DF8F28AE39D9AAB@corporateex02.Corporate.drdc-rddc.gc.ca> |
On Wednesday, November 08, 2006 12:53 PM Ludovic Courtès wrote:
> ...
> However, what I'm interested in is removing the type and type
> conversion information, i.e., the `::' and `primeFactor'. IOW,
> I'd like to get exactly the same information as is available on
> the console (or other output styles), no more. Is this feasible?
> ...
On Wednesday, November 08, 2006 1:56 PM I wrote:
> If you know for certain that you are dealing with a Factored type
> then you can do something like this:
>
> (1) ->
> pureForm(f)==[[i.factor::InputForm,i.exponent::InputForm] for i in factors f]::InputForm
> ...
Maybe this is better since it includes the arithmetic operators:
(1) -> pureForm(p)==reduce(*,[(i.factor^i.exponent)::InputForm for i in factorsp])::InputForm
Type: Void
(2) -> p:=factor((x+y)*(x^2))
2
(2) x (y + x)
Type: Factored Polynomial Integer
(3) -> pureForm p
Compiling function pureForm with type Factored Polynomial Integer
-> InputForm
(3) (* (** x 2) (+ y x))
Type: InputForm
Regards,
Bill Page.