Here is the logic of executing GAP commands via files: if it has := before " write it to file as is otherwise wrap it in Print( ) execute via Read() which has no input on its own
However when multiple commands are fed into gap.eval as in the original post, they all are combined into a single line for which the above algorithm makes no sense - if there is an assignment there will be no output and if there is no assignment multiple commands will be wrapped in a single Print resulting in an error inside GAP. Perhaps it is supposed that there is some logic breaking up multiple commands into separate "lines", but it is obviously broken and in general it is not straightforward since one has to take into account comments, strings, and compound operators like loops. It seems to me that the best fix for the current situation is to prohibit using files completely. Any reasons NOT to do it? I also played a bit with libgap.eval and while it requires a "single" command and complains if I give many, it is happy to accept compound statements like loops. Which makes me think that its restriction on having a single command only is a bit artificial/non-essential. Does anyone know why it is present? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.