[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hex constants (idle question)
- From: Nicolas Noble <pixel@...>
- Date: Thu, 11 Dec 2003 10:49:16 +0100 (CET)
And if you can't find it, or if you want a different one, I made one here:
http://www.nobis-crew.org/~pixel/lua-numbers.patch
that enables direct hex and octal number interpretation from the main
parser, in the usual C syntax.
> 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