Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,27 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Test_Short_Circuit is
|
||||
function A (Value : Boolean) return Boolean is
|
||||
begin
|
||||
Put (" A=" & Boolean'Image (Value));
|
||||
return Value;
|
||||
end A;
|
||||
function B (Value : Boolean) return Boolean is
|
||||
begin
|
||||
Put (" B=" & Boolean'Image (Value));
|
||||
return Value;
|
||||
end B;
|
||||
begin
|
||||
for I in Boolean'Range loop
|
||||
for J in Boolean'Range loop
|
||||
Put (" (A and then B)=" & Boolean'Image (A (I) and then B (J)));
|
||||
New_Line;
|
||||
end loop;
|
||||
end loop;
|
||||
for I in Boolean'Range loop
|
||||
for J in Boolean'Range loop
|
||||
Put (" (A or else B)=" & Boolean'Image (A (I) or else B (J)));
|
||||
New_Line;
|
||||
end loop;
|
||||
end loop;
|
||||
end Test_Short_Circuit;
|
||||
|
|
@ -5,19 +5,19 @@ Func<bool, bool> a = (bool x){ console.writeLine("a"); ^ x };
|
|||
|
||||
Func<bool, bool> b = (bool x){ console.writeLine("b"); ^ x };
|
||||
|
||||
const bool[] boolValues = new bool[]{ false, true };
|
||||
const bool[] boolValues = new []{ false, true };
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
boolValues.forEach::(bool i)
|
||||
{
|
||||
boolValues.forEach::(bool j)
|
||||
{
|
||||
console.printLine(i," and ",j," = ",a(i) && b(j));
|
||||
Console.printLine(i," and ",j," = ",a(i) && b(j));
|
||||
|
||||
console.writeLine();
|
||||
console.printLine(i," or ",j," = ",a(i) || b(j));
|
||||
console.writeLine()
|
||||
Console.writeLine();
|
||||
Console.printLine(i," or ",j," = ",a(i) || b(j));
|
||||
Console.writeLine()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
# Simulated fast function
|
||||
function a ( [boolean]$J ) { return $J }
|
||||
|
||||
# Simulated slow function
|
||||
function b ( [boolean]$J ) { Sleep -Seconds 2; return $J }
|
||||
|
||||
# These all short-circuit and do not evaluate the right hand function
|
||||
( a $True ) -or ( b $False )
|
||||
( a $True ) -or ( b $True )
|
||||
( a $False ) -and ( b $False )
|
||||
( a $False ) -and ( b $True )
|
||||
|
||||
# Measure of execution time
|
||||
Measure-Command {
|
||||
( a $True ) -or ( b $False )
|
||||
( a $True ) -or ( b $True )
|
||||
( a $False ) -and ( b $False )
|
||||
( a $False ) -and ( b $True )
|
||||
} | Select TotalMilliseconds
|
||||
|
||||
# These all appropriately do evaluate the right hand function
|
||||
( a $False ) -or ( b $False )
|
||||
( a $False ) -or ( b $True )
|
||||
( a $True ) -and ( b $False )
|
||||
( a $True ) -and ( b $True )
|
||||
|
||||
# Measure of execution time
|
||||
Measure-Command {
|
||||
( a $False ) -or ( b $False )
|
||||
( a $False ) -or ( b $True )
|
||||
( a $True ) -and ( b $False )
|
||||
( a $True ) -and ( b $True )
|
||||
} | Select TotalMilliseconds
|
||||
Loading…
Add table
Add a link
Reference in a new issue