Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Weird behaviour of Print/View commands in notebook()

Hi not the world's biggest problem, but both on a virtual box version on Windows 7 AND on a Mac OS X 10.6.8 the following GAP code gives bizarre behaviour inside sagenb (of course I encountered it in a real program, but I have managed to distill the problem down to this silly piece of code):

b := 0; for ii in [1..2] do for jj in [1..2] do Print( ii,jj );Print("\n"); Print( jj,ii );Print("\n"); od;; od;;

Now, as it stands this program prints out a series of lines containing the expected numbers. If you comment out the top (dummy) line by placing a # at the beginning of the line, there is suddenly no output. If you then comment out one of (either one!) the "Print..." lines in the middle, then the output re-appears (of course only half as much). It is possible to create other similar pathological behaviour but I guess I've given you the general idea ...

Needless to say, when this type of thing occurs in the middle of large programs it can be utterly baffling!

I presume I am missing something; but I couldn't find this anywhere on the forum ...

Thanks!

Weird behaviour of Print/View commands in notebook()

Hi not the world's biggest problem, but both on a virtual box version on Windows 7 AND on a Mac OS X 10.6.8 the following GAP code gives bizarre behaviour inside sagenb (of course I encountered it in a real program, but I have managed to distill the problem down to this silly piece of code):

b := 0; 0;

for ii in [1..2] do do

for jj in [1..2] do
      Print( ii,jj );Print("\n");
      Print( jj,ii );Print("\n");
  od;;

od;;

Now, as it stands this program prints out a series of lines containing the expected numbers. If you comment out the top (dummy) line by placing a # at the beginning of the line, there is suddenly no output. If you then comment out one of (either one!) the "Print..." lines in the middle, then the output re-appears (of course only half as much). It is possible to create other similar pathological behaviour but I guess I've given you the general idea ...

Needless to say, when this type of thing occurs in the middle of large programs it can be utterly baffling!

I presume I am missing something; but I couldn't find this anywhere on the forum ...

Thanks!

click to hide/show revision 3
No.3 Revision

Weird behaviour of Print/View commands in notebook()

Hi not the world's biggest problem, but both on a virtual box version on Windows 7 AND on a Mac OS X 10.6.8 the following GAP code gives bizarre behaviour inside sagenb (of course I encountered it in a real program, but I have managed to distill the problem down to this silly piece of code):

b := 0;

0; for ii in [1..2] do

do

    for jj in [1..2] do

     Print( ii,jj );Print("\n");

     Print( jj,ii );Print("\n");

    od;;

od;;

od;;

Now, as it stands this program prints out a series of lines containing the expected numbers. If you comment out the top (dummy) line by placing a # at the beginning of the line, there is suddenly no output. If you then comment out one of (either one!) the "Print..." lines in the middle, then the output re-appears (of course only half as much). It is possible to create other similar pathological behaviour but I guess I've given you the general idea ...

Needless to say, when this type of thing occurs in the middle of large programs it can be utterly baffling!

I presume I am missing something; but I couldn't find this anywhere on the forum ...

Thanks!