Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAP interface doesn't handle input with multiple lines correctly #11000

Closed
gvol opened this issue Mar 23, 2011 · 9 comments
Closed

GAP interface doesn't handle input with multiple lines correctly #11000

gvol opened this issue Mar 23, 2011 · 9 comments

Comments

@gvol
Copy link

gvol commented Mar 23, 2011

The following GAP input (say in the notebook)

if 4>3 then
Print("You should see me.");
fi;

gets changed to

if 4>3 thenPrint("You should see me.");fi;

before sending to GAP. Obviously this fails since thenPrint should be two words.

It also doesn't strip comments correctly as can be seen by

## here is a comment
if 4>3 then
 Print("here");
fi

which returns nothing.

Component: interfaces

Keywords: gap

Author: Ivan Andrus

Reviewer: Rob Beezer, Keshav Kini

Merged: sage-4.7.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/11000

@gvol gvol added this to the sage-4.7 milestone Mar 23, 2011
@gvol gvol self-assigned this Mar 23, 2011
@gvol
Copy link
Author

gvol commented Mar 23, 2011

Attachment: trac_11000.patch.gz

@gvol
Copy link
Author

gvol commented Mar 23, 2011

comment:1

The reason they didn't send it all at once seems to be that the interface doesn't properly handle continuation prompts (it deletes enough characters for the whole prompt). Sending all on one line avoids them... except of course when it doesn't. In particular something like

if true then

in the notebook will cause all sorts of unhappiness (3 characters cut off the end of the output) until a cell like

fi

is evaluated. Hopefully this should be fixed now. We probably shouldn't worry too much about the above case since a similar cell with

if false then

will simply cause everything to stop being evaluated until a closing cell is evaluated. I don't see a way around this, and it should probably be considered user error.

@kini
Copy link
Collaborator

kini commented Mar 25, 2011

comment:2

I'm getting doctest errors in, I think, four files, but I stupidly didn't log them. Confirming...

(does this patch depend on any other patches? I'm running it on 4.7.alpha3)

@kini
Copy link
Collaborator

kini commented Mar 25, 2011

comment:3

... OK, I ran the test again.

The following tests failed:

        sage -t -long 4.7.alpha3-main/devel/sage-main/sage/interfaces/maxima.py # 4 doctests failed
        sage -t -long 4.7.alpha3-main/devel/sage-main/sage/tests/startup.py # 1 doctests failed

The startup.py failure is not important, and the maxima failure seems to remain even when I unapply your patch and rebuild, so I have no idea what's going on with that.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Mar 25, 2011

comment:4

This passes all tests for me, plus the two modules Kini mentioned above. Parallel testing on 4.7.alpha1, 64-bit Ubuntu.

@kini
Copy link
Collaborator

kini commented Mar 25, 2011

Reviewer: Rob Beezer, Keshav Kini

@kini
Copy link
Collaborator

kini commented Mar 25, 2011

comment:5

OK, looks all clear to me. Works as advertised, tested manually in the console too. Positive review. I guess the maxima thing is just something weird about alpha2 or alpha3, maybe specific to sage.math.washington.edu, since you guys are using alpha1.

@jdemeyer
Copy link

jdemeyer commented Apr 5, 2011

Changed author from iandrus to Ivan Andrus

@jdemeyer
Copy link

jdemeyer commented Apr 7, 2011

Merged: sage-4.7.alpha4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants