> < ^ Date: Mon, 05 Sep 1994 12:30:00 +0100
> < ^ From: Andrew Mathas <mathas@maths.su.oz.au >
> ^ Subject: a suggestion and a question

A suggestion:
Shouldn't gap have a runtime option, -rc say, which turns off
the automatic reading of the .gaprc file? I tend to put initialisation
commands into the .gaprc file which set up the current project I am
interested in; however sometimes I want to use "plain GAP" (not that it is
really a problem to run the .gaprc file in these cases just unnecessary).

A question on using AppendTo:
I have a function which takes an optional argument of a filename and when
this filename is given all output is dumped to this file. The way I have
done this is as follows:

fn := function(arg)
local fnPrint, file, ... ;

if IsString(arg[1]) then
  file := arg[1];
  fnPrint := function(arg)
    local a;
      for a in arg do
        AppendTo(file, a);
    fnPrint := Print;

and, of course, fnPrint is used throughout fn rather than Print. Now this
works however when a filename is given as an argument to this function it
is significantly slower than when the output goes to the screen. Is there
anyway that I can improve this? It seems to me that the problem with how I
have done this is that AppendTo gets called too often. This suggests
creating a string from arg and then giving it to AppendTo; however, this
doesn't work because most of my objects are records (with specialised
printing instructions), which the String function can't handle.

Any suggestions?

Andrew Mathas
specialised print formats

Many years ago you told me that until you were forty you were very
concerned about what people thought of you. Then you decided to be
concerned about what you thought of other people instead.
Vickram Seth, "A suitable boy"

> < [top]