In message 10 Mar 95 10:42 WET,
Martin Schoenert <martin.schoenert@Math.RWTH-Aachen.DE> writes:
> I am not quite sure what you want to achieve.
To be able to save a session with input and ouput to a file for later
inspection.To be able to save the input of a session to a file say 'gal-1.p'.
To be able to amend the commands in 'gal-1.p' without exiting gap.
To be able to run the program from *within* GAP in order to produce the
input and/or output to the screen, and/or to a file say 'gal-1.log'
(without using print and without exiting gap).
This is nothing special but what I do with the notebook/worksheet interface
of MS windows MATHEMATICA or MAPLE everyday. (actually, in that interface,
one file is enough.) I even would not think of what I really want to achieve
and they are in fact achieved every day. It is user-friendly and one can
*concentrate on the experiment*
rather than worrying about or wasting time with such things as above.
I understand that to ask for a window-based GAP is totally impractical and I
can forsee what will be the response of the GAP's architect. In the present
IBM PC dos-based GAP environment, I know that LogTo, LogInputTo, Read, Print,
PrintTo may be the solution (at least partially) and I have mentioned this,
though not so explict, in my previous message.
Martin continued > If you want to be able to have GAP read commands from a file > and to see both input and output on your screen you can do the > following > > Putting the following commands into the file 'gap-1.p' > > LogInputTo("*stdout*"); > x:=X(Rationals);x.name:="x"; > Galois(x^5-110*x^3-55*x^2+2310*x+979); > TransitiveGroup(5,1); > > and then starting GAP as follows ('-b' surpresses the banner) > > gap -b < gap-1.p > > produces the following output > > gap> gap> x:=X(Rationals);x.name:="x"; > X(Rationals) > "x" > gap> Galois(x^5-110*x^3-55*x^2+2310*x+979); > 1 > gap> TransitiveGroup(5,1); > 5 = C(5) > gap>
Well! I can understand the trick now despite the fact that line 1 of the
output above got a double gap>.
Also, I do not know why gap.bat -b < gal-1.p
does not work on my IBM PC compatible with dos 6.22 though I can make it
work by changing the last line of gap.bat to
%GAP_DIR%\bin\gapdjg -m %GAP_MEM% -l %GAP_DIR%/lib/; -h %GAP_DIR%\doc\
-b < gal-1.p
I find that gapdjg.exe -b < gal-1.p works fine as well.
As one can notice the execution time of
gap> TransitiveGroup(5,1);
gap> TransitiveGroup(5,2);
the second command provides its output almost instantaneously,
I consider the sequence
enetering gap -> run only one program -> automatically exiting gap,
turns out to waste the 'loading time'.
Martin continued
> If you want to do that from a running GAP job, then something like this
> is not possible. This is because only the main interactive loop is a
It would not be too difficult to add a 'ReadWithEcho' to the GAP kernel.
Well! I have the interest in running a program from *within* gap and put
the input and/or output to the screen, and/or to a file (without using print
and without exiting gap).
I would like to know various possible solutions. I am eager to see an
example of system programming too!
More questions:
- I find that gap> Exec("command");
'the shell to dos command' *sometimes* takes a long time. Is there some
way to shorten it?
- I can make gap> Edit("gal-1.p");
works after a lot of time in browsing through the manual. I notice that
it is not a 'pure' edit but is an edit-AND-read, and the turn-around time
is long. How to make a faster and/or 'pure' edit?
Best regards, TangSimon@cuhk.hk