lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 10/02/12 19:25, William Ahern wrote:
[...]
> Not unlike the way strings are internalized in Lua, each unique grapheme
> cluster is dynamically assigned a codepoint at runtime, so that clusters can
> be easily compared.

Now, that's a disturbingly cunning idea. Easy, too. And there's plenty
of space at the top of Unicode code point range for these synthetic code
points. I might have to steal that for a non-Lua project; thanks.

Of course, in Lua, since strings are all internalised anyway, you might
as well use string pointers instead of synthetic codepoints; that way
you let the string internaliser do the heavy lifting and avoid needing a
specialised API, and you still get to do comparisons by comparing
pointers...

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "Never attribute to malice what can be adequately explained by
│ stupidity." --- Nick Diamos (Hanlon's Razor)

Attachment: signature.asc
Description: OpenPGP digital signature