... but would be a nice addition not sure if possible to be coded in... ternary operator's
so many times I feel my self doing
x = (a > b) ? c : d
it is just .... a very very very nice thing.....
Something that isn't in default Lua
Re: Something that isn't in default Lua
Lua intentionally does not implement this sort of operator. They also don't use basic increment/decrement operators (++,--) or the "plusequals" operators ("+=, -=, /=,*=) which is a great frustration to me because I just don't understand why not.
i++
i += 1
is much easier and less keystroke happy than
i = i + 1
i++
i += 1
is much easier and less keystroke happy than
i = i + 1
Re: Something that isn't in default Lua
I'm against patching Lua in Mudlet. That said, you can just learn Lua a bit better; it already provides this:
Re: Something that isn't in default Lua
Thanks didn't think they would be using bit wise operators like this instead thanks
so many languages use that common format ... just figured ya couldn't do it that way
so many languages use that common format ... just figured ya couldn't do it that way
Re: Something that isn't in default Lua
Not bitwise, but logical operators. Just that in Lua they are much more than the traditional boolean logical operators and have many more uses, such as the one Vadi just posted.