[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String indexing again
- From: Tony Finch <dot@...>
- Date: Sun, 19 Dec 2010 22:32:31 +0000
On 19 Dec 2010, at 22:19, Greg Falcon <veloso@verylowsodium.com> wrote:
>
> A subtle point here: This snippet from the manual is talking about
> the *character* at s[1], and Lua doesn't have a character type.
It says character but it means octet.
> There's something awfully
> impure about pretending that a string is a read-only mapping from
> integers to strings.
A string is an array of octets. The mapping from sequences of octets to Unicode codepoints varies, and the relationship between codepoints and glyphs is complicated. I think the concept of "character" is misleadingly simple and should be discarded.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/