lua-users home
lua-l archive

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


On 03/23/2014 10:53 PM, mniip wrote:
Regarding the specifiaction of the base for numeric constants, some
tools I've used in the past had the following, quite clean and
readable, notation:

<base>_<number>

e.g. 2_10101010 , 16_A9 etc.

Perhaps something worth considering for the 'number oriented' 5.3?

Are

That's not really readable. Also what happens if you specify a base
higher than 36?

Yes, higher bases are problematic, but that applies to other methods too.
The issue of readability is subjective, of course.

IMO we are fine with just decimals and hexadecimals. I don't really
think binary literals are that much of a need, as it's trivial to
translate hexadecimal to binary and back. Even C with their binary
flags all over the place don't use any binary literals. Arbitrary
base literals would be an overkill of useless-ness.

I disagree that C should dictate how Lua does things, and neither do I think
it's useless. Something like the above would be a catch all (in addition to
0x) and solve the basic issue once and for all - with the exception of those
very high bases, that is. Oh well, I thought it might be worth airing it :-)

Are
--


---
Denne e-posten er fri for virus og uønsket programvare fordi avast! Antivirusbeskyttelse er aktiv.
http://www.avast.com