Comment Syntax
Josef Svenningsson
josef.svenningsson at gmail.com
Wed Feb 1 20:31:32 EST 2006
I'm in favour of changing the comment syntax.
On 2/2/06, Manuel M T Chakravarty <chak at cse.unsw.edu.au> wrote:
>
> I am against such a change. The change would break existing software
> (eg, Yampa) and secondly I don't buy the "main sources of
> confusion for beginners" argument. The confusion arises only when a
> single line comment is used to uncomment a set of characters that start
> with a special symbol. That's a situation that doesn't arise that
> often. (I'd actually be very happy if the main sources of confusion fpr
> beginners where of such simple syntactic nature.)
Oh yes, it does happen that a single line comment begins with a special
symbol. It has happened to me on several occations when using haddock
annotation to my source code. It is all to easy to forget that extra space.
With incomprehensible error messages as a result.
As for consistency, well if you absolutely want to make it consistent,
> impose the same rule on {- as on --.
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.
Cheers,
/Josef
PS. This discussion is great as a data point for Wadler's Law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-prime/attachments/20060202/7f0b4421/attachment.htm
More information about the Haskell-prime
mailing list