[erlang-questions] Why we need a -module() attribute?

Richard A. O'Keefe ok@REDACTED
Mon Feb 22 00:32:22 CET 2016



On 19/02/16 7:03 pm, Bengt Kleberg wrote:
> Greetings,
>
> Given the problem with case-sensitive file systems, and identifiers in 
> code, why not ignore case?

Actually, there are three approaches file systems have taken:
(1) Normalise case on creation, ignore case when matching.
      IBM MVS, DEC TOPS-10, MS-DOS.
(2) Preserve case on creation, ignore case when matching.
      Classic Mac OS, Mac OS X (own file system), NTFS.
(3) Presrve case on creation, heed case when matching.
      UNIX.

The central problem these days is that both case normalisation
and case ignoring are locale-dependent.  I might write two modules
in locale X which in locale X are clearly different even after converting
to a standard case (Unicode recommands lower case).  But in locale
Y they might be converted to the same string.It seems to work for 
Eiffel. No results from searching for Eiffel and problems with case. It 
is not a large language, so the number of people that have been exposed 
to case insensitivity is small.

The annotated Ada 2012 Reference Manual gets a little confusing:
{AI95-00395-01} {AI05-0227-1}
When this International Standard mentions the conversion of some
character or sequence of characters to upper case, it means the
character or sequence of characters obtained by using simple
upper case mapping<DEL>locale-independent full case folding</DEL>,
as defined by documents referenced in the note in section 1 of
ISO/IEC 1046:2003.
<DEL>Discussion: Unless otherwise specified for sequences of
characters, case folding is applied to the sequence, not to individual
characters. It sometimes can make a difference.</DEL>
...
{AI95-00395-01} We now explicitly define what the Standard means
by uper case, as there are many possibilities for ISO 10646 characters.
{AI05-0227-1} Correction: Upper case is defined by "simple upper case"
mapping", because "full case folding" is a mapping (mostly) to lower case.
{AI95-00285-01}The description of the language definition in this
International Standard uses the character properties General Category,
Simple Uppercase Mapping, Uppercase Mapping, and Special Case
Condition of the documents referenced by the note in section 1 of
ISO/IEC 10646:2003.

It took *years* for the Ada people to sort out exactly what they meant by
case conversion, and the result is quite clearly WRONG for some users.

Tht's not really the problem.  The problem is that file systems that
ignore case (one way or the other) will have their OWN rules about
case conversion, and we cannot expect them to match Ada's or any
other language's exactly.

There are plenty of arguments for case insensitivity in programming 
languages.
I don't think this one will work. though.




More information about the erlang-questions mailing list