Talk:Or operator: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>NXTBoy
No edit summary
>NXTBoy
No edit summary
(No difference)

Revision as of 15:04, 15 July 2011

or isn't limited to if statements. Needs examples of other users, such as y = nil; x = y or 5, and then x is 5 not nil.

Trappingnoobs (Writer) Come check out my User page!
What is the purpose of this page? We shouldn't make a page on a specific operator (unless there is a lot to it). For instance, rather than make a page on or, make a page on logical operators and a page on ternary.
(Merlin11188 | Send Message | E-mail | Wiki Writer)
22:19, 14 July, 2011 - UTC
Logical operators should be part of the Boolean page. However, and and or, in Lua, are not strictly logical operators. This should be made clear somewhere.
03:21, 15 July 2011 (UTC)
They definitely shouldn't be in the boolean page. Why would they go there? Just make a page on Ternary :/
(Merlin11188 | Send Message | E-mail | Wiki Writer)
06:05, 15 July, 2011 - UTC
Couple of mistakes you've made. Firstly, by definition, logical operators apply to logical values, that is booleans. So therefore, logical operators, being boolean operators, should be on the boolean page. The issue here is that lua's and and or operators are not truly logical operators, since they do not always return booleans. So I guess a separate page would be handy.
The more important point is that a and b or c is NOT "the ternary operator", just like in C, where a ? b : c is NOT "the ternary operator". In C, it is "the conditional operator", which happens to be a ternary operator, since it takes three operands. In lua, it's not even an operator - it's just an idiom. If I had to name it, I'd go with "the conditional idiom"
15:04, 15 July 2011 (UTC)