lua-users home
lua-l archive

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


Rici Lake wrote:

> function X(str) return tonumber(str, 16) end
> print(X"2A")

That's a good solution. Very few down sides (X in the global table,
extra string literals).

The patch also provides for hexadecimal escape characters within
strings; it sounds like Todor does not need that. I find it to be very
useful, though there are Lua ways around that, too. If you don't need
speed and you don't have a problem with the overhead involved, stick
with the Lua-only solutions.

Doug

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_