03-27-2023, 06:22 PM
(12-28-2022, 01:44 AM)grymmjack Wrote: I will return to this to explain but mostly this is self-explanatory stuff.
If I were offering this code to other people I'd turn all those % into &&, and give a better name to that ln$ and change the input parameter type to && instead of !. This is so that it's useful with any integer type. What if you needed pretty-print for an _INTEGER64?
Also I prefer the "value&& * (-1)" instead of "-value&&" that somebody else proposed. It clearly explains what is going on. But then again this is a "toolbox" not meant for beginners trying to learn BASIC programming.
I was going to write something else just above but the following works, does give me -5 in Lua:
Code: (Select All)
value = 5
print(-value)
Those metatables are as slick as the programmer wants them to be...