Derek Holt writes in his e-mail message of 1994/08/20
gap> a:=AbstractGenerator("a");
gap> String(a);
Error, String: cannot convert a into a string in
String( a ) called from
main loopThat is annoying! Is there any reason why the String function shouldn't
convert the abstract generator into the supplied string? That ought to
be exactly what the string is there for.
No, the *real* reason that 'AbstractGenerator' takes a string is
different. I forbade global functions that don't take any arguments in
GAP. And since nobody could think of something useful to pass to
'AbstractGenerator' we selected a string. Boy, that came in handy
when we finally came around to implement printing of objects ;-).
He continues
And similarly for words in
abstract generators. Is there any other way of getting the printing
string for a word, other than by doing something silly like writing
to a file enclosed in quotes, and reading back in?
As far as I can tell this is the only way, because only 'Print' and
relatives looks at the string. Of course once you can handle generators
there are lots of options to handle words.
This is sad, because otherwise we could start a competition to find
the most silly way.
I guess what annoys you most is the realization that a kernel function
that maps generators to strings would only be a couple of lines long,
but that it is impossible to do it with a library function.
Unfortunately I cannot fix it in the upcoming update 3r4p1, because we
decided that we don't want any kernel changes in this update. But I
shall send you a patch which will than later become part of the second
update (whenever that might come). Others that are also interested in
such a function should write to 'GAP-Trouble'.
Take it easy, Martin.
-- .- .-. - .. -. .-.. --- ...- . ... .- -. -. .. -.- .- Martin Sch"onert, Martin.Schoenert@Math.RWTH-Aachen.DE, +49 241 804551 Lehrstuhl D f"ur Mathematik, Templergraben 64, RWTH, 52056 Aachen, Germany