Talk:Or operator: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Merlin11188 No edit summary |
>NXTBoy No edit summary |
||
Line 3: | Line 3: | ||
:<div style="border-top: 1px dotted #AAA;color:#000000;font-size:10px">([[User:Merlin11188|Merlin11188]] | [http://www.roblox.com/My/PrivateMessage.aspx?RecipientID=128839 Send Message] | [http://wiki.roblox.com/index.php/Special:EmailUser/Merlin11188 E-mail] | Wiki Writer)<div style="float:right;">22:19, 14 July, 2011 - UTC</div></div> | :<div style="border-top: 1px dotted #AAA;color:#000000;font-size:10px">([[User:Merlin11188|Merlin11188]] | [http://www.roblox.com/My/PrivateMessage.aspx?RecipientID=128839 Send Message] | [http://wiki.roblox.com/index.php/Special:EmailUser/Merlin11188 E-mail] | Wiki Writer)<div style="float:right;">22:19, 14 July, 2011 - UTC</div></div> | ||
::Logical operators should be part of the [[Boolean]] page. However, <code>and</code> and <code>or</code>, in Lua, are not strictly logical operators. This should be made clear somewhere. {{User:NXTBoy/sig|date=03:21, 15 July 2011 (UTC)}} | ::Logical operators should be part of the [[Boolean]] page. However, <code>and</code> and <code>or</code>, in Lua, are not strictly logical operators. This should be made clear somewhere. {{User:NXTBoy/sig|date=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 :/ | :::They definitely shouldn't be in the boolean page. Why would they go there? Just make a page on Ternary :/ <div style="border-top: 1px dotted #AAA;color:#000000;font-size:10px">([[User:Merlin11188|Merlin11188]] | [http://www.roblox.com/My/PrivateMessage.aspx?RecipientID=128839 Send Message] | [http://wiki.roblox.com/index.php/Special:EmailUser/Merlin11188 E-mail] | Wiki Writer)<div style="float:right;">06:05, 15 July, 2011 - UTC</div></div> | ||
::::Couple of mistakes you've made. Firstly, by definition, logical operators apply to logical values, that is [[boolean]]s. So therefore, logical operators, being boolean operators, should be on the [[boolean]] page. The issue here is that lua's <code>and</code> and <code>or</code> 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 <code>a and b or c<code/> is '''NOT''' "the ternary operator", just like in C, where <code>a ? b : c<code/> 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" {{User:NXTBoy/sig|date=15:04, 15 July 2011 (UTC)}} |
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.
-
- Logical operators should be part of the Boolean page. However,
and
andor
, in Lua, are not strictly logical operators. This should be made clear somewhere.- They definitely shouldn't be in the boolean page. Why would they go there? Just make a page on Ternary :/
- 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
andor
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"
- 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
- They definitely shouldn't be in the boolean page. Why would they go there? Just make a page on Ternary :/
- Logical operators should be part of the Boolean page. However,