Re: [Haskell-cafe] Comment Syntax

2011-06-08 Thread Ketil Malde
Guy guytsalmave...@yahoo.com writes: Out of interest, is there any other language where the comment delimiter is invalid if immediately followed by a symbol? Another quaint example, in shell scripts, lines starting with '#' are comments, except when the first line starts with '#!'.

Re: [Haskell-cafe] Comment Syntax

2011-06-08 Thread Ivan Lazar Miljenovic
On 8 June 2011 18:13, Ketil Malde ke...@malde.org wrote: Guy guytsalmave...@yahoo.com writes: Out of interest, is there any other language where the comment delimiter is invalid if immediately followed by a symbol? Another quaint example, in shell scripts, lines starting with '#' are

Re: [Haskell-cafe] Comment Syntax

2011-06-08 Thread Ketil Malde
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes: And #! in the first line is also treated as a comment in Haskell code so that you can run it as a script. True. But then you're allowed to add arbitrary symbols after it, I think. At least, GHC seems happy about it. -k -- If I haven't

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Guy
On 06/06/2011 22:14, Evan Laforge wrote: Back to Haskell: I agree, the choice of the comment delimiter was not the best in light of the possibility to define operators containing it as a substring. But changing it to have --| start a comment too might break too much code (and eliminating -- as a

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Ivan Lazar Miljenovic
On 7 June 2011 17:41, Guy guytsalmave...@yahoo.com wrote: On 06/06/2011 22:14, Evan Laforge wrote: Back to Haskell: I agree, the choice of the comment delimiter was not the best in light of the possibility to define operators containing it as a substring. But changing it to have --| start a

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Guy
On 07/06/2011 10:45, Ivan Lazar Miljenovic wrote: On 7 June 2011 17:41, Guyguytsalmave...@yahoo.com wrote: On 06/06/2011 22:14, Evan Laforge wrote: Back to Haskell: I agree, the choice of the comment delimiter was not the best in light of the possibility to define operators containing it as

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Ivan Lazar Miljenovic
On 7 June 2011 17:50, Guy guytsalmave...@yahoo.com wrote: On 07/06/2011 10:45, Ivan Lazar Miljenovic wrote: On 7 June 2011 17:41, Guyguytsalmave...@yahoo.com  wrote: I originally posted because I found that --| stood out much more clearly as a structured comment than -- |. How does a

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Guy
On 07/06/2011 10:55, Ivan Lazar Miljenovic wrote: On 7 June 2011 17:50, Guyguytsalmave...@yahoo.com wrote: On 07/06/2011 10:45, Ivan Lazar Miljenovic wrote: On 7 June 2011 17:41, Guyguytsalmave...@yahoo.comwrote: I originally posted because I found that --| stood out much more clearly

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Ketil Malde
Guy guytsalmave...@yahoo.com writes: Out of interest, is there any other language where the comment delimiter is invalid if immediately followed by a symbol? Perl has a rather infamous example where the comment syntax may depend on run-time properties - would that count? whatever / 25 ;

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Guy
On 07/06/2011 10:55, Ivan Lazar Miljenovic wrote: Another argument against special-casing --|: what happens if you want to use a _different_ documentation generator (I don't know why you would, but someone might) than Haddock, which uses a different markup identifier? We can declare new

Re: [Haskell-cafe] Comment Syntax

2011-06-07 Thread Richard O'Keefe
On 7/06/2011, at 9:36 PM, Guy wrote: Out of interest, is there any other language where the comment delimiter is invalid if immediately followed by a symbol? Not exactly what you asked, but in some implementations of Algol, comment This is a comment; commentThis is a syntax

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Richard O'Keefe
On 4/06/2011, at 5:12 AM, Andrew Coppin wrote: I'm curious to know why anybody thought that -- was a good comment marker in the first place. (I'm curious because Haskell isn't the only language to have made this strange choice.) Indeed. The Wikipedia lists Euphoria, Haskell, SQL, Ada,

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Nicolas Wu
This whole discussion is reminding me of Wadler's Law of Language Design [1], it's nice to see that in 15 years things haven't changed much! WADLER'S LAW OF LANGUAGE DESIGN In any language design, the total time spent discussing a feature in this list is proportional to two raised to

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Henning Thielemann
Nicolas Wu schrieb: This whole discussion is reminding me of Wadler's Law of Language Design [1], it's nice to see that in 15 years things haven't changed much! WADLER'S LAW OF LANGUAGE DESIGN In any language design, the total time spent discussing a feature in this list is

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Albert Y. C. Lai
Bearing in mind that the characters that have been used to begin end of line comments include *, /, ;, !, #, %, and $, it's not clear that there's anything _that_ regrettable about -- . Recall that the problem is not with isolated characters, but whole strings. -- a is a comment, --a is a

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Daniel Fischer
On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote: Bearing in mind that the characters that have been used to begin end of line comments include *, /, ;, !, #, %, and $, it's not clear that there's anything _that_ regrettable about -- . Recall that the problem is not with isolated

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Nick Bowler
On 2011-06-06 13:08 -0400, Albert Y. C. Lai wrote: Recall that the problem is not with isolated characters, but whole strings. [...] in LaTeX, %%@#$^* is a comment. This example probably does not help your position. Since (La)TeX allows the comment character to be changed at any time, the

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Nick Bowler
On 2011-06-06 13:39 -0400, Nick Bowler wrote: On 2011-06-06 13:08 -0400, Albert Y. C. Lai wrote: Recall that the problem is not with isolated characters, but whole strings. [...] in LaTeX, %%@#$^* is a comment. This example probably does not help your position. Since (La)TeX allows the

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Albert Y. C. Lai
On 11-06-06 01:34 PM, Daniel Fischer wrote: On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote: Recall that the problem is not with isolated characters, but whole strings. -- a is a comment, --a is a comment, but ---a is not. It is. Report, section 2.3: Sorry. Then --| is not a

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Daniel Fischer
On Monday 06 June 2011, 19:51:44, Albert Y. C. Lai wrote: On 11-06-06 01:34 PM, Daniel Fischer wrote: On Montag, 6. Juni 2011, 19:08, Albert Y. C. Lai wrote: Recall that the problem is not with isolated characters, but whole strings. -- a is a comment, --a is a comment, but ---a is

Re: [Haskell-cafe] Comment Syntax

2011-06-06 Thread Evan Laforge
Back to Haskell: I agree, the choice of the comment delimiter was not the best in light of the possibility to define operators containing it as a substring. But changing it to have --| start a comment too might break too much code (and eliminating -- as a comment starter would certainly break

Re: [Haskell-cafe] Comment Syntax

2011-06-05 Thread Jon Fairbairn
Albert Y. C. Lai tre...@vex.net writes: On 11-06-04 02:20 AM, Roman Cheplyaka wrote: It is, for my taste, a good comment marker, because of its resemblance to a dash. It makes the code look like real text: let y = x + 1 -- increment x COBOL is real text, if that is what you want. MOVE

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Roman Cheplyaka
* Andrew Coppin andrewcop...@btinternet.com [2011-06-03 18:12:04+0100] On 03/06/2011 05:02 PM, Albert Y. C. Lai wrote: I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. I'm curious to know why anybody thought that -- was a good comment

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Jon Fairbairn
Roman Cheplyaka r...@ro-che.info writes: * Andrew Coppin andrewcop...@btinternet.com [2011-06-03 18:12:04+0100] On 03/06/2011 05:02 PM, Albert Y. C. Lai wrote: I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. I'm curious to know why

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Albert Y. C. Lai
On 11-06-04 02:20 AM, Roman Cheplyaka wrote: It is, for my taste, a good comment marker, because of its resemblance to a dash. It makes the code look like real text: let y = x + 1 -- increment x COBOL is real text, if that is what you want. ___

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Yves Parès
*Touché.* Nice one. 2011/6/4 Albert Y. C. Lai tre...@vex.net On 11-06-04 02:20 AM, Roman Cheplyaka wrote: It is, for my taste, a good comment marker, because of its resemblance to a dash. It makes the code look like real text: let y = x + 1 -- increment x COBOL is real text, if that

[Haskell-cafe] Comment Syntax

2011-06-03 Thread Guy
-- followed by a symbol does not start a comment, thus for example, haddock declarations must begin with -- |, and not --|. What might --| mean, if not a comment? It doesn't seem possible to define it as an operator. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Max Rabkin
On Fri, Jun 3, 2011 at 10:32, Guy guytsalmave...@yahoo.com wrote: -- followed by a symbol does not start a comment, thus for example, haddock declarations must begin with -- |, and not --|. What might --| mean, if not a comment? It doesn't seem possible to define it as an operator. GHCi, at

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Ivan Lazar Miljenovic
On 3 June 2011 18:32, Guy guytsalmave...@yahoo.com wrote: -- followed by a symbol does not start a comment, thus for example, haddock declarations must begin with -- |, and not --|. What might --| mean, if not a comment? It doesn't seem possible to define it as an operator. Sure you can; --|

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Malcolm Wallace
-- followed by a symbol does not start a comment, thus for example, haddock declarations must begin with -- |, and not --|. What might --| mean, if not a comment? It doesn't seem possible to define it as an operator. GHCi, at least, allows it. Prelude let (--|) = (+) Prelude 1 --| 2

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Guy
On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was -- which is not of course used anywhere in the standard libraries, but is an extremely nice symbol to have available in user code. Seeing as no

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Ivan Lazar Miljenovic
On 3 June 2011 19:19, Guy guytsalmave...@yahoo.com wrote: On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was      -- which is not of course used anywhere in the standard libraries, but is an extremely

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Guy
On 03/06/2011 12:26, Ivan Lazar Miljenovic wrote: On 3 June 2011 19:19, Guyguytsalmave...@yahoo.com wrote: On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was -- which is not of course used

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Serguey Zefirov
2011/6/3 Guy guytsalmave...@yahoo.com: I wasn't proposing additional comment symbols; I'm proposing that anything beginning with -- is a comment. I use -- as a infix operator to describe types in Template Haskell. So I too oppose your proposal. ;)

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Daniel Schoepe
On Fri, 03 Jun 2011 12:19:31 +0300, Guy guytsalmave...@yahoo.com wrote: On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was -- which is not of course used anywhere in the standard libraries,

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Ivan Lazar Miljenovic
On 3 June 2011 20:32, Daniel Schoepe daniel.scho...@googlemail.com wrote: On Fri, 03 Jun 2011 12:19:31 +0300, Guy guytsalmave...@yahoo.com wrote: On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was  

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Steffen Schuldenzucker
Am 03.06.2011 10:32, schrieb Guy: What might --| mean, if not a comment? It doesn't seem possible to define it as an operator. Obviously, anyone who is going to write a formal logic framework would want to define the following operators ;) : T |- phi: T proves phi T |-- phi: T proves phi

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Brandon Allbery
On Fri, Jun 3, 2011 at 05:19, Guy guytsalmave...@yahoo.com wrote: On 03/06/2011 12:01, Malcolm Wallace wrote: I believe the motivating example that persuaded the Language Committee to allow these symbols was      -- which is not of course used anywhere in the standard libraries, but is an

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Albert Y. C. Lai
I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. Two birds in one stone: 1. Removes the cause of the mistake of writing a haddock comment as --| That is, if no one writes any comment with -- then no one writes any haddock comment with --|

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Andrew Coppin
On 03/06/2011 05:02 PM, Albert Y. C. Lai wrote: I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. I'm curious to know why anybody thought that -- was a good comment marker in the first place. (I'm curious because Haskell isn't the only

Re: [Haskell-cafe] Comment Syntax

2011-06-03 Thread Ivan Lazar Miljenovic
On 4 June 2011 02:02, Albert Y. C. Lai tre...@vex.net wrote: I propose that only {- -} is comment; that is, -- is an operator token and not a marker of comments. Two birds in one stone: 1. Removes the cause of the mistake of writing a haddock comment as --| That is, if no one writes any