| Yet another H98 question, this time regarding the module | Char: Is it a deliberate design decision that readLitChar | handles decimal, octal, and hex escapes, but lexLitChar | handles only decimal ones? It looks more like an oversight to me...
Me too. It's a messy part of the language that both readLitChar and lexLitChar exist, with pretty much duplicate code. Still, I'd rather not rewrite it all (easy to introduce more bugs). But it is unfortunate that the two actually parse different escape sequences. Would anyone like to volunteer to write missing code for lexLitChar? Below is the stuff from the Report that describes the spec | Another question is if the uppercase variants '\O...' and | '\X...' should be forbidden explicitly. Current | implementations seem to differ in this aspect. Implementation shouldn't accept \O \X etc. I don't think it's appropriate to forbid it... should we forbid \A (read number base 35) too? Simon The function showLitChar converts a character to a string using only printable characters, using Haskell source-language escape conventions. The function lexLitChar does the reverse, returning the sequence of characters that encode the character. The function readLitChar does the same, but in addition converts the to the character that it encodes. For example: showLitChar '\n' s = "\\n" ++ s lexLitChar "\\nHello" = [("\\n", "Hello")] readLitChar "\\nHello" = [("\n", "Hello")] _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell