lua-users home
lua-l archive

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


I believe there is a patch on the Wiki for string hex constants.

+++++++++++++++++++++++++++++++++
>I'd like my users to be able to type in hexadecimal (and possibly binary) 
>constants in as painless a way as possible. Currently I have:
>
>  n = htoi("c3")
>
>which of course works fine, but makes complex expressions less readable for an 
>inexperienced user. 
>Is there a simpler way? I thought of:
>  
>  n = hex.c3
>
>but it would work only for hex constants beginning with a letter. The 
>alternative:
>
>  n = const.h3c
>
>seems ugly and error-prone.
>Did I miss other possibilities?
>
>  Enrico