Comment Syntax

John Meacham john at
Wed Feb 1 20:53:37 EST 2006

On Thu, Feb 02, 2006 at 02:31:32AM +0100, Josef Svenningsson wrote:
> I still think there is an inconsistency here. And it has to do with maximal
> munch lexing. Maximal munch is what we normally expect from a lexer for a
> programming language. But the way comments work at the moment breaks maximal
> munch. The longest possible read is to read the whole line as a comment and
> not interpret for instance --^ as an operator. It breaks any programmers'
> intuition not only beginners'. I still get it wrong from time to time.

huh? this is exactly the opposite. maximal munch means that it would
consume everything and then interpret it as an operator. having it the
other way would be a special case because you would have to stop
consuming input after the first --.

Though, I certainly think compilers could produce better error messages
when they see a line that begins with whitespace and then has an
operator starting with -- that leads to a type error. but that is not
really a language issue.


John Meacham - ⑆⑆john⑈ 

More information about the Haskell-prime mailing list