character literal question

Iavor Diatchki iavor.diatchki at gmail.com
Sat Dec 2 16:40:46 EST 2006


Hello,

> It does actually make syntax hilighting more complex, and introduces
> another special case.

How is that another special case? If anything, it seems to be removing
a special case because there is no need for an escape of the form \'.
Do you have a concrete example of what it complicates?

> It's also no longer "the same" as strings, since
> """ doesn't mean "\"".

Fair enough, but it is easy to explain why these are different.  Can
we explain why we need to escape the quote in character literals?  So
far we have: (i) we want to be different from Ada, and (ii) we want to
do the same as C and Java.

A nice property of the small change that I proposed is that to switch
between a singleton string and a character we just need to change the
quotes.  With the current notation we have to also add a backslash if
the string happened to be "'", which seems redundant.

Anyways, this is not a big thing but it seems like a wrinkle that
could be fixed.

-Iavor


More information about the Haskell-prime mailing list