[erlang-questions] byte() vs. char() use in documentation

Kostis Sagonas <>
Mon May 2 12:13:08 CEST 2011


Raimo Niskanen wrote:
> 
> This became messy when char() was re-defined from latin-1 character
> to unicode character. That affected string() that affected iolist()
> and the latter was incorrect.
> 
> We must clean up the mess.

Right.  The sooner it happens the better it is.

> ... Either by completing the notion of char()
> being unicode and hence rewriting iolist() to contain byte() and binary(),
> or by reverting to char() being latin-1 char and using unicode:char()
> and unicode:string() where that is correct...

Please, by all means do the former.  The latter will only cause havoc 
everywhere.  For starters, I do not see any need in having two different 
basic types (byte() and char()) denoting (pretty much) the same thing. 
The only thing this does is cause unnecessary confusion to newcomers 
(and apparently to some old-timers too).  Second, if you choose the 
latter you will eventually have to change lots of type inference code, 
because I promise you I will not do this, and believe me you don't want 
to go there... (The Vietnam jungle is probably a friendlier place ;) )

Cheers,
Kostis



More information about the erlang-questions mailing list