#11401: magma mode in 4.7 notebook broken
------------------------+---------------------------------------------------
   Reporter:  nbruin    |          Owner:  jason, mpatel, was      
       Type:  defect    |         Status:  needs_review            
   Priority:  major     |      Milestone:  sage-4.7.2              
  Component:  notebook  |       Keywords:  magma notebook interface
Work_issues:            |       Upstream:  N/A                     
   Reviewer:            |         Author:                          
     Merged:            |   Dependencies:                          
------------------------+---------------------------------------------------

Comment(by nbruin):

 I think I now have a proper fix for the problem. The problem is indeed
 caused by the fix of #9705.
 The matter is the following (and this will be true for a lot of
 interfaces):
  - Magma essentially responds to each newline with a new prompt. So, when
 you are feeding input to magma via its stdin, the most straightforward way
 is to do this line by line and eat the prompts as you go along. This
 happened before the fix of #9705.
  - The decision to transfer via file or via stdin was made on a line-by-
 line basis. So, newlines inside expressions could lead to input being
 split over several files and/or a bit of stdin. This caused #9705. The fix
 introduced there solves the problem by introducing split_lines. With
 split_lines=False, one can end up with multi-line input in
 expect._eval_line. When _eval_line decides to communicate those lines via
 stdin then there is a mismatch between the number of prompts generated and
 the number expected.

 The solution in {{{trac_11401v2.patch}}} is to move the decision to use
 files to "eval". This makes it possible to either transmit all code via a
 temp file or to send the input line-by-line to stdin (and those lines will
 never trigger file use). I think this is also more efficient because it
 favours transfer in bigger blocks (before the #9705 fix, input consisting
 of many short lines would still be communicated via stdin. Now it will be
 communicated via one tmp file)

 This means that the {{{split_lines}}} option can now take 3 values. The
 option "use one file OR split lines" is the right behaviour for magma and
 probably for most other interfaces too.

 I have also added a doctest testing that #11401 is fixed. I also
 reintroduced the newlines in the test for #9705. Those are actually
 essential for testing (the version without newlines always worked as
 expected).

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