#13178: problem with newlines in gap eval
------------------------------+---------------------------------------------
       Reporter:  kcrisman    |         Owner:  was     
           Type:  defect      |        Status:  new     
       Priority:  major       |     Milestone:  sage-5.2
      Component:  interfaces  |    Resolution:          
       Keywords:  gap         |   Work issues:          
Report Upstream:  N/A         |     Reviewers:          
        Authors:              |     Merged in:          
   Dependencies:              |      Stopgaps:          
------------------------------+---------------------------------------------

Comment (by iandrus):

 There are two ways that sage sends data to GAP.  The first is to send it
 line by line, and the second is to send it via a file.  This last is used
 when there is a lot of data because, IIRC, it's faster.  However, this
 messes up the use of stdout e.g. Print.  So what's happening is if the
 input is long enough, it goes to a file.  That's why removing some of the
 prints makes a difference.  You can also get the same effect by adding a
 bunch of spaces in the middle (they are stripped from the beginning and
 the end).

 One way around this is to use
 {{{
 gap.eval(...., allow_use_file=False)
 }}}
 which allows you to see that this is in fact the cause of the problem.
 The second method is to change the cutoff (default is 100)
 {{{
 gap._eval_using_file_cutoff = 1000
 }}}
 or disable it entirely

 {{{
 self._eval_using_file_cutoff = None
 }}}

 You can set it in `~/.sage/init.sage` to make it "permanent".

 As for a truly permanent solution, we could try disabling it if we see a
 function that prints to stdout like Print or Display, but it wouldn't work
 for custom functions.  I don't think there is a way around this based on
 how GAP is currently written (except not using a file), but I could be
 wrong.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13178#comment:3>
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