|
List Info
Thread: "ocaml_beginners"::[] comment with weird message error
|
|
| "ocaml_beginners"::[] comment
with weird message error |

|
2007-01-25 05:39:31 |
|
Hello
why this comment line below gives a wrong error message ?
(* some comment with " *)
File "test.ml", line 1, characters 0-2:
Comment not terminated
Thanks
François Colonna
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
comment with weird message error |

|
2007-01-25 08:23:26 |
|
> why this comment line below gives a wrong error message ?
>
> (* some comment with " *)
> File "test.ml", line 1, characters 0-2:
> Comment not terminated
>
# (* blah "blah" " *) " blah *) 1+1;;
- : int = 2
It seems in my example that " *) " is a string within a comment. In
your example, I think that you only used one quotation mark, so the
string was not terminated. Therefore the comment around your string
could also not be terminated.
I don't like this compiler behavior, but I don't usually make
unterminated quotes anyway.
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
comment with weird message error |

|
2007-01-25 10:58:45 |
|
On Thu, 25 Jan 2007, Eric Lavigne wrote:
> I don't like this compiler behavior, but I don't usually make
> unterminated quotes anyway.
It's a design tradeoff -- you can either allow unterminated comments in
quotes or unterminated comments in quotes, but doing both is either not
doable or just more work to do correctly than it's worth (probably the
latter -- I'd doubt it's an undecidable problem..). Anyway, it does seem
to me that the comments inside quotes pattern would happen more often than
the other way around (think code generating code).
William D. Neumann
---
"There's just so many extra children, we could just feed the
children to these tigers. We don't need them, we're not doing
anything with them.
Tigers are noble and sleek; children are loud and messy."
-- Neko Case
Life is unfair. Kill yourself or get over it.
-- Black Box Recorder
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
comment with weird message error |

|
2007-01-25 11:43:22 |
|
> > I don't like this compiler behavior, but I don't usually make
> > unterminated quotes anyway.
>
> It's a design tradeoff -- you can either allow unterminated comments in
> quotes or unterminated comments in quotes, but doing both is either not
> doable or just more work to do correctly than it's worth (probably the
> latter -- I'd doubt it's an undecidable problem..). Anyway, it does seem
> to me that the comments inside quotes pattern would happen more often than
> the other way around (think code generating code).
>
> William D. Neumann
>
I also would think that solving the problem correctly is more trouble
than it's worth, but supporting more features isn't the only issue
here. It is nice to be able to put quote marks in comments, but I can
resist with symbols like <quote>. It would be nice to be able to put
comments in generated code, but I can just replace them with
statements "let comment = "here is my comment." " or just not worry
about it because I don't usually read generated code. The more
interesting issue to me is the warning message.
My concern here is the situation that just happened. In which the
combination of a quote and a comment led to confusing behavior. If the
compiler had also complained that a quote at line xxx had not been
closed, I think the original poster would never have needed to ask on
the list. I haven't checked the source, but a change like that doesn't
sound hard.
Eric
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
comment with weird message error |

|
2007-01-29 04:17:43 |
|
Eric Lavigne wrote:
> I also would think that solving the problem correctly is more trouble
> than it's worth, but supporting more features isn't the only issue
> here. It is nice to be able to put quote marks in comments, but I can
> resist with symbols like <quote>. It would be nice to be able to put
> comments in generated code, but I can just replace them with
> statements "let comment = "here is my comment." " or just not worry
> about it because I don't usually read generated code. The more
> interesting issue to me is the warning message.
>
> My concern here is the situation that just happened. In which the
> combination of a quote and a comment led to confusing behavior. If the
> compiler had also complained that a quote at line xxx had not been
> closed, I think the original poster would never have needed to ask on
> the list. I haven't checked the source, but a change like that doesn't
> sound hard.
>
> Eric
>
>
Exactly.
The error was due to an unpaired double quote included in a comment.
The compiler message was very confusing because it pointed only the
first comment
mark and not the unpaired doubled quote.
Francois Colonna
__._,_.___
.
__,_._,___
|
[1-5]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|