[GAP Forum] IntHexString bug?

Frank Luebeck frank.luebeck at math.rwth-aachen.de
Thu Nov 25 16:59:33 GMT 2004


On Tue, 16 Nov 2004, Kenn Heinrich wrote:

> Is this a bug? It looks like IntHexString only handles StringRep
> strings, while other functions like LowercaseString, EvalString, and
> Chomp can handle either explicit char lists or StringRep strings.
[...]
> s1 := "a";
> s2 := ['a'];
> s1 = s2; # evaluates to true as expected
> LowercaseString(s1) = LowercaseString(s2); # true as expected
> IntHexString(s1); # 10 as expected
> IntHexString(s2); # gives a non-valid character error

Dear Kenn Heinrich, dear Forum,

Thanks for this example! You are right, this is a bug (and the error
message from the last line is strange). It was forgotten to mention
in the documentation that the argument should be in IsStringRep.

For the moment, please, apply 'ConvertToStringRep' to a string in list
of characters representation before using it as argument for IntHexString.

In one of the next updates of GAP I will change IntHexString to silently
convert its argument if necessary.

With best regards,

  Frank Luebeck

///  Dr. Frank Lübeck, Lehrstuhl D für Mathematik, Templergraben 64,  ///
\\\                    52062 Aachen, Germany                          \\\
///  E-mail: Frank.Luebeck at Math.RWTH-Aachen.De                        ///
\\\  WWW:    http://www.math.rwth-aachen.de/~Frank.Luebeck/           \\\







More information about the Forum mailing list