lua-users home
lua-l archive

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


Op Ma. 17 Des. 2018 om 22:48 het Egor Skriptunoff
<egor.skriptunoff@gmail.com> geskryf:
>
> 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:
>>
>> 0b1011'1100'0001
>>
>> I'd prefer the underscore as a separator, though:
>>
>> 0b1011_1100_0001
>
>
>
> 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).

Must it be an ASCII character? Why not Unicode/UTF8, as in 1 000 000?