Jump to content

Logical operations: Difference between revisions

m
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).
 
<syntaxhighlight lang="langur">val .test = fn(.a, .b) join("\n",{ [
join("\n", [
$"not \.a;: \{not .a}",
$"not \.a; and: \.b;:{not \.a and .b;}",
$"\.a; orand \.b;: \.a orand .b;",
$"\.a; nand \.b;: \.a nand .b;",
$"\.a; noror \.b;: \.a noror .b;",
$"\.a; xornor \.b;: \.a xornor .b;",
$"\.a; nxorxor \.b;: \.a nxorxor .b;",
$"not \.a;: nxor \{not.b;: \.a} nxor .b;",
"",
 
$"not? \.a;: \{not? .a}",
$"\.a; andnot? \.ba;: \.a and{not? .b;a}",
$"\.a; orand? \.b;: \.a orand? .b;",
$"\.a; nand? \.b;: \.a nand? .b;",
$"\.a; noror? \.b;: \.a noror? .b;",
$"\.a; xornor? \.b;: \.a xornor? .b;",
$"\.a; nxorxor? \.b;: \.a nxorxor? .b;",
$"\n.a; nxor? \.b;: \.a nxor? .b;",
"\n",
])
}
 
val .tests = [
1,007

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.