#7377: Symbolic Ring to Maxima via EclObject
-----------------------------------------------------------------------+----
   Reporter:  nbruin                                                   |       
Owner:  nbruin      
       Type:  enhancement                                              |      
Status:  needs_work  
   Priority:  major                                                    |   
Milestone:  sage-feature
  Component:  symbolics                                                |    
Keywords:              
     Author:  Nils Bruin, Jean-Pierre Flori                            |    
Upstream:  N/A         
   Reviewer:  Jean-Pierre Flori, François Bissey, Karl-Dieter Crisman  |      
Merged:              
Work_issues:                                                           |  
-----------------------------------------------------------------------+----

Comment(by nbruin):

 Replying to [comment:59 jpflori]:
 > So I get the same errors as reported above. I don't know why Maxima gets
 so verbose ("rat:...", "solve:...", ascii art things in desolve, "-- an
 error.  To debug this try debugmode(true);"...), was it intended in the
 patches ?

 That's wonderful! A cleaner refactoring as proposed above would be great.
 Concerning the verbosity: Maxima is always like that. With the current
 interface, pexpect receives this and filters it out. With the library
 setup, we're not listening to stdout anymore, so this ends up with the
 user. Possible solutions:

  - get maxima patched to have options to remove these warnings &
 verbosity. There are already a few out there (no error message is printed
 anymore thanks to turning one off), but others survive (the " -- an error
 occurred ..." is hard-wired. I've reported that one to Maxima)

  - live with it (that shouldn't be necessary)

  - redirect lisp standard output. Thankfully, lisp wraps all its I/O in
 its own stream system which allows for redirection so if we feed (setf
 *standard-output* *dev-null*) to ECL during maxima initialization, we'll
 never see anything (obviously not a good idea for debugging). Perhaps we
 also need that on *standard-error*. In fact, since a lot of this output
 does not seem to affect doctesting, perhaps it's already ending up on
 stderr.

 This actually suggests another approach to getting a strings-based
 interface to maxima/ECLlib:

  - locate the Maxima Read/Evaluate/Print loop and break it open to just be
 a Read/Evaluate/Print routine maxima-rep (i.e., it returns instead of
 looping)
  - wrap this routine:
 {{{
 (defun mrep-with-stringio (maxima-input-string)
    (let ((*standard-input* (make-string-input-stream maxima-input-string))
          (*standard-output* (make-string-output-stream)))
       (maxima-rep)
       (get-output-stream-string *standard-output*)
 ))
 }}}
 This approach would be a little closer to the current pexpect interface,
 so you could possibly reuse more of the current maxima pexpect interface.
 You'd still only be communicating with maxima via string I/O, though,
 whereas we can do much better with the library. It would be an option if
 all you're interested in is creating an I/O based interface to maxima
 without fork.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7377#comment:61>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to