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
problem with newlines in gap eval #13178
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Yeah, this is maddening.
|
comment:3
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
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)
or disable it entirely
You can set it in 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. |
comment:4
Hmm, I don't know that one would want to completely disable it, but at least MUCH better documentation on exactly when to expect this problem - and how to work around it, like your suggestions - would be really helpful to close this ticket. Also, how horrible would it be to expand the cutoff to something higher in general? |
See this sage-support thread.
Basically,
erroneously adds newlines, while
doesn't return anything at all (well, the empty string).
doesn't help, though it seems like there must be something going on related to it, given the first command.
This makes (for instance) a lot of stuff not work in the notebook with %gap.
Component: interfaces
Keywords: gap
Issue created by migration from https://trac.sagemath.org/ticket/13178
The text was updated successfully, but these errors were encountered: