[erlang-questions] A proposal for Unicode variable and atom names in Erlang.

Richard O'Keefe ok@REDACTED
Tue Oct 30 05:33:04 CET 2012


On 22/10/2012, at 8:48 PM, Michael Uvarov wrote:

> There is no such thing as "language" in Unicode.

Actually, that's not quite true.  Unicode *does* include so-called
"language tags", so it is perfectly possible to mark up sections
of text with the language they are supposed to be in, all in straight
Unicode.
> 
> "language" is a locale.

No, locale is more specific than that.  A locale is a script, a language,
a set of cultural conventions for writing numbers and money and dates,
and so on.  An "English" phone book and an "English" dictionary would
use different locales, because they use different rules for sorting.

> Locale-based algorithms are difficult and each
> character can have different meaning for each locale.

Locale-based algorithms are difficult, true.

Give one example of a character that has a different meaning
in two locales.  OK, character stand for different *sounds*
in different languages, but there is no case I can find in Unicode
where the class a character belongs to depends on the locale.

> There are a lot of cases, when I even cannot say which case a variable
> is in.

Tell me just ONE.  Hint: there aren't _any_ such cases.
Each defined Unicode character has one and only one class, and that
class is not in any way locale- or context-dependent.


> How I will detect is it a variable or an atom?

The proposal you are claiming to comment on gives a precise,
unambiguous, and natural way to do so, which is consistent with
other programming languages making a case distinction.
> 
> Here is an example:
> I want to write a module in Turkish, then the  "length" id will be a
> variable, not a function.

What on earth are you talking about?  Lower case l is a lower case
letter, whether you're writing English, Turkish, or Old High Martian.
> 
> Using code, written in few languages will be a hell.

WE ALREADY HAVE THAT POSSIBILITY RIGHT NOW.

You could, *right now*, have a module containing words from a
couple of dozen languages.  Imagine a mixture of English,
Swedish, Irish, Klingon, and Latino Sine Flexione.

Guess what?  IT DOESN'T HAPPEN!

At most we get a mixture of English and one other language.




More information about the erlang-questions mailing list