lua-users home
lua-l archive

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


On Sat, Feb 11, 2012 at 12:20:42AM +0000, David Given wrote:
> 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...
> 

Yeah. I didn't connect the dots on the string interning till after I sent
the message.

Here's more info on NFG in Parrot and Perl 6:

http://docs.parrot.org/parrot/latest/html/docs/pdds/pdd28_strings.pod.html