lua-users home
lua-l archive

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


Interesting. Does not work with Lua 5.1/5.2 though.

On Wed, Aug 17, 2016 at 3:57 AM, Martin <eden_martin_fuhrspam@gmx.de> wrote:
Occasionally discovered while experimenting with syntax parser:

Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> print(0)
0
> print(~0)
-1
> print(-~0)
1
> print(~-~0)
-2
> print(-~-~0)
2
> print(~-~-~0)
-3
> print(-~-~-~0)
3
> print(~-~-~-~0)
-4
> print(-~-~-~-~0)
4

May use "1" too.