Clue icon indicating copy to clipboard operation
Clue copied to clipboard

Increment operators like `x++` and `++x`

Open defaultzone opened this issue 1 year ago • 1 comments

To increment number in Clue we using

x += 1

But it's ugly(imho), it's rather to use increment operators since it can shorten many lines of code, for example:

// Can replace this by single line: print(tbl[++x])
x += 1
print(tbl[x])

Can implement in Clue like this:

Clue:

print(x++)
print(++x)

Lua:

print(x)    -- x++
x = x + 1   -- x++
x = x + 1   -- ++x
print(x)    -- ++x

defaultzone avatar Dec 08 '23 07:12 defaultzone