axiom-mail
[Top][All Lists]
Advanced

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

[Axiom-mail] Re: Outputting S-expressions


From: Ludovic Courtès
Subject: [Axiom-mail] Re: Outputting S-expressions
Date: Tue, 07 Nov 2006 10:38:59 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi,

Themos Tsikas <address@hidden> writes:

> (1) -> p:=(1+x)^5
>
>          5     4      3      2
>    (1)  x  + 5x  + 10x  + 10x  + 5x + 1
>                                                      Type: Polynomial Integer
> (2) -> VALUES(p)$Lisp
>
>    (2)  (1 x (5 0 . 1) (4 0 . 5) (3 0 . 10) (2 0 . 10) (1 0 . 5) (0 0 . 1))
>                                                             Type: SExpression

Actually, I want a "parsable" S-exp, like `(** (+ 1 x) 5)' in this case.

In the meantime, I found `convert' and `$Lisp', so what I do is the
following:

  -> p := (1+x)^5
  -> )fin
  BOOT> (defun my-output (sexp)
          (with-open-file (out "out.sexp" :direction :output)
            (format out "~a~%" sexp)))
  BOOT> (|spad|)
  -> sexp := convert(p)
  -> (my-output sexp)$Lisp

However, I can't get `my-output' to be visible from Spad.  Hint?

Thanks,
Ludovic.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]