Folks, here's a clarification about comment syntax.

Simon

|The new draft (which you won't have seen) says:
|
|"An ordinary comment begins with a lexeme consisting of
|two or more consecutive dashes (e.g. @--@) and extends to the following
|newline.  The comment must begin with a lexeme consisting entirely of 
| dashes, {\em parsed according to the maximal-much rule}.  In particular 
| ``@-->@'' or ``@--|@'' do {\em not} begin a comment, because the lexeme 
| does not consist entirely of dashes."

> I think so, here are some examples:
> 
> Starts a comment: `--', `-------', `--Hello', `--(', `--;', `--_'
> 
> Does not start a comment: `-->', `--=>', `--\', `--.', `--|', `--->',
> `--? What is this', `--! Amazing', `--½ done', `--® Microsoft',
> `--© 1998 Microsoft', `--«Nothing»'.

Yes, these are correct.

> What about: `{----' and `----}' (the latter appears in the Hugs
> prelude)?  These aren't clear to me (unless there's a separate
> statement on these in the draft).

Good point. As now stated, these are lexemes distinct from
'{-' and '-}', so they would not be nested-comment delimiters.

Come to think of it, that's good:

        {- This is a string "-}" burble -}

would now not be confused by the quoted -}; the lexeme is
a string not a '-}' thing.


Simon


Reply via email to