On Fri, May 3, 2019 at 5:10 PM E. Madison Bray <erik.m.b...@gmail.com> wrote: > > On Fri, May 3, 2019 at 5:06 PM E. Madison Bray <erik.m.b...@gmail.com> wrote: > > > > On Mon, Apr 29, 2019 at 2:30 AM Andrey Novoseltsev <novos...@gmail.com> > > wrote: > > > > > > Hello, > > > > > > I got a report about GAP problem in SageMathCell, but it looks like the > > > GAP interface in Sage itself is having issues. I am getting an empty > > > string from the following command: > > > sage: print(gap.eval(""" > > > ....: D_4 := SmallGroup(8,3); > > > ....: IsAbelian( D_4 ); > > > ....: List( ConjugacyClasses( D_4 ), Size ); > > > ....: IsCyclic( D_4 ); > > > ....: Size( AllSubgroups( D_4 ) ); > > > ....: Size( Set( D_4, Order ) ); > > > ....: IsSolvable( D_4 );""")) > > > > > > All commands work fine in GAP and even in Sage each one seems to be > > > working, but certain combinations of them do not, while some do - I can't > > > understand the system here... > > > > > > Does anyone have any ideas on what is going on? > > > > It might be a bug in the pexpect interface I guess. If I try, say, > > just the first 2 or 3 snippets of the code you gave above I get the > > full output. But by the `Size( AllSubgroups( D_4 ) );` it becomes > > empty. I if I do just `D_4 := SmallGroup(8,3); Size( AllSubgroups( > > D_4 ) );` it produces the correct output. > > Oh duh, I re-read the rest of the thread, and as Vincent pointed out, > this is above the (seemingly arbitrary?) _eval_using_file_cutoff. > > I'm not sure why that's so buggy but I'm sure we can figure it out...
I see; it's because it writes the commands to a file, and then executes the file in GAP by calling Read(...) on the filename, which doesn't necessarily produce output for each command. This is just like the difference in Python between entering several lines of code one-by-one in the REPL, versus simply executing a script. You won't see the result of each line unless it were wrapped in Print() or something. Surely there is a better solution... -- 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.