lua-users home
lua-l archive

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


Am 23.11.2014 um 19:32 schröbte tonyp@acm.org:

Regarding the length of a number being different depending on what
numbering system is used, this is correct and expected behavior.
Would you want the length of hex ABCD to be anything other than four?

You seem to. `#tostring(0xABCD)` (or in case you have `__len` for numbers like you propose: `#0xABCD`) is neither four nor six. Same problem for `#"1E9"` vs. `#1E9`, so this would be a case where you cannot use numbers and numeric strings interchangeably.

Philipp