Talk:Or operator: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Merlin11188
No edit summary
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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.<div style="border-top: 1px solid #AAA; color:#000000; font-size:10px">Trappingnoobs <span style="color:skyblue">(Writer)</span><span style="color:red"> Come check out my [[User_talk:Trappingnoobs|User page]]!</span></div>
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.<div style="border-top: 1px solid #AAA; color:#000000; font-size:10px">Trappingnoobs <span style="color:skyblue">(Writer)</span><span style="color:red"> Come check out my [[User_talk:Trappingnoobs|User page]]!</span></div>
: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.  
: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.  
<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</syntaxhighlight> and <code>or</syntaxhighlight>, 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 :/ <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</syntaxhighlight> and <code>or</syntaxhighlight> 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</syntaxhighlight> is '''NOT''' "the ternary operator", just like in C, where <code>a ? b : c</syntaxhighlight> 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)}}
:::::Then they shouldn't go on the boolean page; you contradicted yourself. If they aren't boolean operators, they shouldn't be on the boolean page. Also, that's a name I approve of; furthermore, we should make a ternary page, anyway. It isn't like that would harm anything. One last question: if or is "the conditional idiom" then would that make and "the requirement idiom"? <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;">03:26, 16 July, 2011 - UTC</div></div>
::::::It's the combination of and and or that makes the conditional idiom.{{User:NXTBoy/sig|date=07:47, 16 July 2011 (UTC)}}

Latest revision as of 05:05, 27 April 2023

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</syntaxhighlight> and or</syntaxhighlight>, 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</syntaxhighlight> and or</syntaxhighlight> 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</syntaxhighlight> is NOT "the ternary operator", just like in C, where a ? b : c</syntaxhighlight> 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)
Then they shouldn't go on the boolean page; you contradicted yourself. If they aren't boolean operators, they shouldn't be on the boolean page. Also, that's a name I approve of; furthermore, we should make a ternary page, anyway. It isn't like that would harm anything. One last question: if or is "the conditional idiom" then would that make and "the requirement idiom"?
(Merlin11188 | Send Message | E-mail | Wiki Writer)
03:26, 16 July, 2011 - UTC
It's the combination of and and or that makes the conditional idiom.
07:47, 16 July 2011 (UTC)