Logical operations: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) |
Langurmonkey (talk | contribs) |
||
Line 2,250: | Line 2,250: | ||
Operators that end with ? are null propagating or "database" operators, and will return null if either operand is null. They short-circuit differently than normal operators (only if the left operand is null). |
Operators that end with ? are null propagating or "database" operators, and will return null if either operand is null. They short-circuit differently than normal operators (only if the left operand is null). |
||
<syntaxhighlight lang="langur">val .test = fn(.a, .b) |
<syntaxhighlight lang="langur">val .test = fn(.a, .b) { |
||
join("\n", [ |
|||
⚫ | |||
$"\.a; |
$"not \.a;: \{not .a}", |
||
$"\.a; |
$"\.a; and \.b;: \.a and .b;", |
||
$"\.a; nand \.b;: \.a nand .b;", |
$"\.a; nand \.b;: \.a nand .b;", |
||
$"\.a; |
$"\.a; or \.b;: \.a or .b;", |
||
$"\.a; |
$"\.a; nor \.b;: \.a nor .b;", |
||
$"\.a; |
$"\.a; xor \.b;: \.a xor .b;", |
||
⚫ | |||
"", |
"", |
||
$"not? \.a;: \{not? .a}", |
|||
$" |
$"not? \.a;: \{not? .a}", |
||
$"\.a; |
$"\.a; and? \.b;: \.a and? .b;", |
||
$"\.a; nand? \.b;: \.a nand? .b;", |
$"\.a; nand? \.b;: \.a nand? .b;", |
||
$"\.a; |
$"\.a; or? \.b;: \.a or? .b;", |
||
$"\.a; |
$"\.a; nor? \.b;: \.a nor? .b;", |
||
$"\.a; |
$"\.a; xor? \.b;: \.a xor? .b;", |
||
"\ |
$"\.a; nxor? \.b;: \.a nxor? .b;", |
||
"\n", |
|||
]) |
]) |
||
} |
|||
val .tests = [ |
val .tests = [ |