Word wrap in magma interface

asked 2011-04-17 17:33:18 -0500

David Jordan gravatar image

updated 2011-06-16 07:46:19 -0500

Kelvin Li gravatar image

Hi all,

I'm experiencing a strange phenomenon when using the sage interface to magma, through the notebook interface (in firefox and chrome browsers, on separate computers). If I enter a command that is long enough to require word-wrapping in the standard input window, it causes the magma interpreter to throw an error. As best I can tell, it is passing the newline to magma erroneously. That is, I don't intend to have a newline there, but it's still causing an error. I was baffled what was causing the error, but then I broke the code (a long sum) into two shorter lines, each a command for half of the code for the sum.

Can anyone offer advice how to work with long lines of code in the sage magma interface, without having to awkwardly break them up? Thanks, David

edit retag flag offensive close merge delete

Comments

Are you using "%magma" at the top of each cell or selecting "magma" as the interpreter? Or are you using the "magma.eval(...)" method? Sorry, I don't have a copy of magma to play with.

Kelvin Li gravatar imageKelvin Li ( 2011-04-17 17:50:50 -0500 )edit

Hi, I should have specified that. I'm using "magma" as the interpreter on the top of the screen. One might ask why I'm not just using the magma terminal interface directly, but it's because I'm using the sharing features in sage notebook to allow several people to work on the same file remotely. Except for this really odd bug, it's working well...

David Jordan gravatar imageDavid Jordan ( 2011-04-18 03:01:39 -0500 )edit

For the purposes of a workaround, does magma have a line-continuation character? I know Python can extend lines with the backslash "\" character. Another question: does changing the number of line wrappings in the cell (by adjusting the browser window width or zooming in/out) affect this behavior?

Kelvin Li gravatar imageKelvin Li ( 2011-04-18 08:22:03 -0500 )edit