> < ^ Date: Fri, 10 Mar 1995 10:42:00 +0100 (WET)
> < ^ From: Martin Schoenert <martin.schoenert@math.rwth-aachen.de >
< ^ Subject: Re: Run a program of Chapter 16.
Tang Ko Cheung wrote in his e-mail message of 1995/03/02
gap> x:=X(Rationals);x.name:="x";
gap> Galois(x^5-110*x^3-55*x^2+2310*x+979);
gap> TransitiveGroup(5,1);
5 = C(5)

Very nice! Put it in a file say "gal-1.p", one need to type

x:=X(Rationals);x.name:="x"; Print("x:=X(Rationals);x.name:='x'; \n\n");
Print("Galois(x^5-110*x^3-55*x^2+2310*x+979); \n");
Print(Galois(x^5-110*x^3-55*x^2+2310*x+979), "\n\n");
Print("TransitiveGroup(5,1); \n");

and type

gap> Read("gal-1.p");

to run it. It needs a lot of extra typing!

Being a user of IBM PC for years, I still have no idea of using I/O
redirection to make "Read("gal-1.gap")" output something to the screen
without using "Print".

What is in my mind is the batch file feature (with echo on/off) of
MS-DOS so then I may use "LogTo" or "LogInputTo" to achieve the purpose
easily. Will "Read" get some extra switches in the future?

I am not quite sure what you want to achieve.

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

Putting the following commands into the file 'gap-1.p'


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";
gap> Galois(x^5-110*x^3-55*x^2+2310*x+979);
gap> TransitiveGroup(5,1);
5 = C(5)

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
read-eval-print loop (actually a <print-prompt>-read-eval-print loop).
'Read' only does a read-eval loop (i.e. no printing).
It would not be too difficult to add a 'ReadWithEcho' to the GAP kernel.
If this is what you want, I would be glad to show you how to do it.

He continued

-><- The release of GAP 3.4 of July/94 brings the birth of
         Chapter 16 Algebraic Extensions,
     but there is only a few discussions up to now.  -><-

I am completely at loss to interpret this. Is it a question?
A call for discussions? Or an observation?


-- .- .-. - .. -.  .-.. --- ...- . ...  .- -. -. .. -.- .-
Martin Sch"onert,   Martin.Schoenert@Math.RWTH-Aachen.DE,   +49 241 804551
Lehrstuhl D f"ur Mathematik, Templergraben 64, RWTH, 52056 Aachen, Germany

> < [top]