lua-users home
lua-l archive

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


On Thu, May 19, 2016 at 9:07 PM, Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
> On Mon, May 16, 2016 at 5:04 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
>
>> Am 16.05.2016 um 14:34 schröbte Jonne Ransijn:
>>>
>>> I don't really like the 1'000'000 syntax,
>>
>>
>> Me neither.
>>
> Personally I would be happy with any choice of separator symbol.
> My suggestion about using single quote is based on C++ syntax.
> I presume that probably many C++ programmers are already
> accustomed to use single quote for separating digit groups.
>
> Java's variant with underscore is good enough, but it may be a bit
> confusing due to similarity of variable names to number literals:
> local _100_000 = 1_000_000
> It would be a nice feature for obfuscating Lua programs :-)
>
> BTW, we have a backtick symbol not used in Lua syntax yet.

To add to the examples of how this is done in other languages,
Python's PEP 515 to allow underscores in numeric literals [1] was
accepted by the BDFL last week [2] and will appear in Python 3.6, to
be released this coming December.

[1] https://www.python.org/dev/peps/pep-0515/
[2] https://mail.python.org/pipermail/python-dev/2016-May/144551.html