Dear all,

I was trying to turn an SExpression into a (compact) String.  My final goal 
is to try to avoid "unparse$InputForm" in the sage interface.

In particular, I would prefer a solution which does not contain any 
unnecessary whitespace.

I know of

FORMAT('NIL, "~S", (-1/2)::INFORM)$Lisp

but this has some undesirable side effects with the rootOf operator, which 
I do not understand:

r := integrate(72000/(1+x^5),x)::INFORM
FORMAT('NIL, "~S", r)$Lisp

   (5)
  "(/
 (+
  (*
   (+
    (^
     (+
      (+
       (* -3
          (^
        
     #1=(|rootOf|
               (+
                (+
                 (+
    
                (^
                   #2=(|rootOf|
                       (+
  
                        (+
                         (+ (+ (^ %%E0 4) (* 14400 (
  ^ %%E0 3)))
                            (* 207360000 (^ %%E0 2)))
           
                (* 2985984000000 %%E0))
                        429981696000000
  00)
                       %%E0)
                   3)
...

I also tried brightPrint(r)$Lisp, which yields a very compact display (the 
result is the empty SExpression, but I guess I could capture the output or 
somehow modify brightPrint), but it omits whitespace in the top level list:

(8) -> brightPrint((-1/2)::INFORM)$Lisp
/-12
   (8)  ()
                                                            Type: 
SExpression


Thanks for any hints!

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to