lua-users home
lua-l archive

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

On Mon, Dec 17, 2018 at 1:43 PM Lorenzo Donati wrote:
Numeric optional separator: I crave this, together with a standard
syntax for binary literals[1] . C++ addressed both needs with the syntax:


I'd prefer the underscore as a separator, though:


In Lua syntax a literal number is never followed by a literal string, so C++ syntax (1'000'000) is suitable for Lua too.
IMO, 1'000'000 looks nicer than 1_000_000.
But probably my opinion is biased because 1'000'000 is one of the standard ways to write numbers in Russian texts (space is also used as thousands separator).
BTW, fast googling showed that "upper dot/upper comma" are used as digit groups separators (at least in handwriting) in some other countries: Belgium, Italy, Romania, Switzerland, Mexico, Liechtenstein.
In English-speaking countries a comma is used as separator, that's why many people prefer something bottom-ish (such as underscore).