lua-users home
lua-l archive

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


Really non-standard, but should I mention the erlang format (maybe ada, too) for N-base constants again?

(http://lua-users.org/lists/lua-l/2006-02/msg00231.html)

to re-cap:

2#1001 = binary
8#777 = octal
16#deadbeef = hexadecimal
36#hello = base 36

I have a stale 5.0 patch I can update if anyone cares.

-joe

On Thu, Feb 5, 2009 at 4:54 PM, RJP Computing <rjpcomputing@gmail.com> wrote:
On Thu, Feb 5, 2009 at 3:04 PM, Sam Roberts <vieuxtech@gmail.com> wrote:
It appears the patch doesn't pass the "0b" prefix to strtol(), it
strips it, and requests base conversion using the last argument to
strtol().

I like it, its nice for bit fields, and it would be nice to have a %b
string.format specifier, too.

I would love to see this in Lua 5.2.
--
Regards,
Ryan