lua-users home
lua-l archive

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

Chung Jiho wrote:
> 2. No "equal" tag method - I don't know if this is intended or not.
> But comparing two unicode user data needs tag method "equal" but
> there seems to be only "lt". builtin operator "==" for userdata seems
> to test identity (the same pointer) but not equivalence (comparing
> each characters, etc...) ...
> Is the only solution implementing some function like "ustrcmp"?

You could do it the same way Lua does it with strings: map all "equal"
strings to the same userdata.

Ciao, ET.