Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007740OCamlcompiler driverpublic2018-02-21 15:052018-02-21 19:22
Reportervanto 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformLinuxOSDebianOS Version9
Product Version4.02.3 
Target VersionFixed in Version 
Summary0007740: ISO-Latin 1 characters with Linux does not work version 4.02.3-9 for Debian
Descriptionversion 4.02.3-9 for Debian

vanto@debian9:~$ ocaml
        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 ReproduceType in a terminal (linux) int_of_char ('é');;
then Enter
at this moment a warning and an error message appears, but the line
has changed.
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)
TagsNo tags attached.
Attached Files

- Relationships
related to 0007737resolvedoctachron A few character codes do not match in ISO 8859-1 with an azerty keyboard 

-  Notes
(0018899)
xleroy (administrator)
2018-02-21 15:52

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
int_of_char ('é');;
$ od -t c foo
0000000 i n t _ o f _ c h a r ( ' 303 251
0000020 ' ) ; ; \n
0000025
$ 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
0000025

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.
(0018901)
vanto (viewer)
2018-02-21 18:53

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.
(0018902)
xleroy (administrator)
2018-02-21 19:22

You crossed the line. This is a bug tracking system, not a place to vent your frustrations. That was your last post here.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker