Looking at the magma.eval() function, I see that if the string to be
passed to magma does not end in ';' then a semicolon is appended.
That is clearly intended for convenience (Sage users are not used to
ending lines with ';') but must cause problems with continuation
lines, surely?

I tried Nils's exact code after first setting
sage: magma = Magma(logfile="magma.log")

and afterwards the log file contains

Magma V2.17-5     Mon May 30 2011 17:45:19 on John-laptop [Seed = 1409144779]
Type ? for help.  Type <Ctrl>-D to quit.
SetPrompt(">>>"); SetLineEditor(false); SetColumns(0);
SetPrompt(">>>"); SetLineEditor(false); SetColumns(0);
> SetPrompt(">>>"); SetLineEditor(false); SetColumns(0);
>>>AttachSpec("/home/john/.sage/temp/John_laptop/19013/dir_0/data//spec");
AttachSpec("/home/john/.sage/temp/John_laptop/19013/dir_0/data//spec");
>>>a:=1;b:=2;
a:=1;b:=2;
>>>print a,b;
print a,b;
1 2
>>>a:=1;
b:=2;
a:=1;
b:=2;
>>>print a,b;
>>>print a,b;
print a,b;
1 2
>>>print a,b;
quit
1 2
>>>quit
>>>

in case that helps!

John

On Mon, May 30, 2011 at 5:15 PM, Nils Bruin <nbr...@sfu.ca> wrote:
> This will probably help the person who is going to track down this
> bug: It's not just in the notebook and it looks like newlines in the
> input knock the interface out of sync (but not always!) The following
> example fails reliably for me:
>
> sage: magma.execute("a:=1;b:=2;")
> ''
> sage: magma.execute("print a,b;")
> '1 2'
> sage: magma.execute("""a:=1;
> ....: b:=2;""")
> 'b:=2;'
> sage:  magma.execute("print a,b;")
> ''
>
> The first two lines work as expected. The third line seems to ruin it
> (that "b:=2;" should be executed, not echoed) and after that nothing
> works
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to