[erlang-questions] correct terminology for referring to strings

Richard O'Keefe <>
Thu Aug 2 03:58:42 CEST 2012


On 1/08/2012, at 7:32 PM, Michael Turner wrote:

> On Wed, Aug 1, 2012 at 1:33 PM, Richard O'Keefe <> wrote:
>> 
>> On 31/07/2012, at 9:53 PM, Michael Turner wrote:
>> 
>>>> << An Erlang "string" is simply a list of integers.  Each integer can
>>>> represent any Unicode codepoint/character. >>
>>> 
>>> Except that Unicode codepoints represents characters, right?
>> 
>> Wrong.
> 
> Actually, what's *really* wrong in my statement is the grammar -- bad
> plural agreement.

No, what's wrong is the assertion that Unicode codepoints
represent characters.

> I'm certain this is correct, Richard, but ... what problem are we
> trying to solve again?

Having Joe not accidentally lying to his readers.


> IIRC: Joe is trying to come up with a short
> passage that explains what strings are, in Erlang. If he writes all
> that you wrote above, the reader (who might have been initially
> excited about Erlang) will come away with the impression, "Erlang
> people are excruciatingly pedantic".

Nobody ever said that >Joe< should say all that.

What he needs to say is something like
+++	Unicode is actually insanely complicated,
+++	but a good starting point is that each character
+++	named in the Unicode standard is assigned a
+++	unique integer called a codepoint,
+++	and an Erlang string is just a list of these numbers.

The phrase 'named in the standard' makes this literally true; it also
asserts that characters are given codepoints (true), not that
odepoints represent characters (false).

>>> << In Erlang, strings are represented as lists of integers. These
>>> integers are Unicode codepoints, each representing a character. >>
>>> 
>>> That way, anybody who's unclear on what "codepoint" means gets a
>>> freebie definition of it. In the Unicode context, it's probably wrong,
>>> technically, but perhaps good enough for this purpose.
> 
> Can anyone tell me why this *wouldn't* serve Joe's (== the typical
> reader's) purposes? [*]

Because it is dangerously wrong and misleading.
Why say what is untrue, when you can say something true that is
nearly as simple and serves the job just as well?



More information about the erlang-questions mailing list