|Anonymous | Login | Signup for a new account||2018-12-13 03:48 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007740||OCaml||compiler driver||public||2018-02-21 15:05||2018-02-21 19:22|
|Status||resolved||Resolution||no change required|
|Target Version||Fixed in Version|
|Summary||0007740: ISO-Latin 1 characters with Linux does not work version 4.02.3-9 for Debian|
|Description||version 4.02.3-9 for Debian|
OCaml version 4.02.3
# int_of_char ('a');;
- : int = 97
# int_of_char (_'é');;;
Warning 3: deprecated: ISO-Latin1 characters in identifiers
Error: Syntax error: operator expected.
this error also occurs with version 4.01.0-5 for Debian.
|Steps To Reproduce||Type in a terminal (linux) int_of_char ('é');;|
at this moment a warning and an error message appears, but the line
an underscore was added under the first apostrophe and a third
semi-colon appeared after the other two as you can see above. (I
had to add the underscore here because it was not saved in the copy and
paste.But in reality the underscore is well below the first apostrophe)
|Tags||No tags attached.|
You really need to ask for help on discuss.ocaml.org rather than post reports here: that will get you more friendly feedback.
Your Debian terminal is using Unicode with UTF-8 encoding, not ISO Latin 1. So, what looks to you like a correct character literal 'é' actually looks to OCaml like '\xc3\xa9', that is, two bytes between the quotes. Check forr yourself:
$ cat > foo
$ od -t c foo
0000000 i n t _ o f _ c h a r ( ' 303 251
0000020 ' ) ; ; \n
$ od -t x1 foo
0000000 69 6e 74 5f 6f 66 5f 63 68 61 72 20 28 27 c3 a9
0000020 27 29 3b 3b 0a
If you really want to use ISO Latin 1 accented characters, you'll need to configure a console and a text editor to use this encoding instead of Unicode/UTF8. That's nontrivial and a reason why most of us just no longer use accented characters in OCaml sources, except in comments and possibly strings.
Oh, by the way: the parentheses in int_of_char ('a') are not needed and considered poor style.
Replying to the administrator.
Haskell in linux works fine. Splendid is'nt it?
Why OCaml is not better ??????? Waterloo again?
Change the code page to fit all systems. After all, it's not up to the
user to adapt to the quirks of the compiler. We are in the twenty-
first century. It is urgent to adapt.
What do you do with the characters that the compiler has added of
itself in the expression? This is not a bug?
"... that will get you more friendly feedback." You say.
What does that mean?
"Oh, by the way: the parentheses in int_of_char ('a') are not needed and considered poor style." You say.
One more thing.
If you consider this style of writing as poor, what are you waiting for to erase it from the compiler?
Since the compiler allows me to write it.
After all, it's you who made this compiler! CQFD.
|You crossed the line. This is a bug tracking system, not a place to vent your frustrations. That was your last post here.|
|2018-02-21 15:05||vanto||New Issue|
|2018-02-21 15:52||xleroy||Note Added: 0018899|
|2018-02-21 15:52||xleroy||Status||new => resolved|
|2018-02-21 15:52||xleroy||Resolution||open => no change required|
|2018-02-21 15:52||xleroy||Relationship added||related to 0007737|
|2018-02-21 18:53||vanto||Note Added: 0018901|
|2018-02-21 19:22||xleroy||Note Added: 0018902|
|Copyright © 2000 - 2011 MantisBT Group|