Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,20 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Test_If_2 is
|
||||
|
||||
type Two_Bool is range 0 .. 3;
|
||||
|
||||
function If_2(Cond_1, Cond_2: Boolean) return Two_Bool is
|
||||
(Two_Bool(2*Boolean'Pos(Cond_1)) + Two_Bool(Boolean'Pos(Cond_2)));
|
||||
|
||||
begin
|
||||
for N in 10 .. 20 loop
|
||||
Put(Integer'Image(N) & " is ");
|
||||
case If_2(N mod 2 = 0, N mod 3 = 0) is
|
||||
when 2#11# => Put_Line("divisible by both two and three.");
|
||||
when 2#10# => Put_Line("divisible by two, but not by three.");
|
||||
when 2#01# => Put_Line("divisible by three, but not by two.");
|
||||
when 2#00# => Put_Line("neither divisible by two, nor by three.");
|
||||
end case;
|
||||
end loop;
|
||||
end Test_If_2;
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
if2: function [cond1 cond2 both one two none][
|
||||
case []
|
||||
when? [and? cond1 cond2] -> do both
|
||||
when? [cond1] -> do one
|
||||
when? [cond2] -> do two
|
||||
else -> do none
|
||||
when [
|
||||
and? cond1 cond2 -> do both
|
||||
cond1 -> do one
|
||||
cond2 -> do two
|
||||
true -> do none
|
||||
]
|
||||
]
|
||||
|
||||
if2 false true [print "both"]
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
EVALUATE EXPRESSION-1 ALSO EXPRESSION-2
|
||||
WHEN TRUE ALSO TRUE
|
||||
DISPLAY 'Both are true.'
|
||||
WHEN TRUE ALSO FALSE
|
||||
DISPLAY 'Expression 1 is true.'
|
||||
WHEN FALSE ALSO TRUE
|
||||
DISPLAY 'Expression 2 is true.'
|
||||
WHEN OTHER
|
||||
DISPLAY 'Neither is true.'
|
||||
END-EVALUATE
|
||||
|
|
@ -1 +0,0 @@
|
|||
Notation "A /\ B" := (and A B)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
(defmacro if2 (cond1 cond2 both first second &rest neither)
|
||||
(let ((res1 (gensym))
|
||||
(res2 (gensym)))
|
||||
`(let ((,res1 ,cond1)
|
||||
(,res2 ,cond2))
|
||||
(cond ((and ,res1 ,res2) ,both)
|
||||
(,res1 ,first)
|
||||
(,res2 ,second)
|
||||
(t ,@neither)))))
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
function When-Condition
|
||||
{
|
||||
[CmdletBinding()]
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true, Position=0)]
|
||||
[bool]
|
||||
$Test1,
|
||||
|
||||
[Parameter(Mandatory=$true, Position=1)]
|
||||
[bool]
|
||||
$Test2,
|
||||
|
||||
[Parameter(Mandatory=$true, Position=2)]
|
||||
[scriptblock]
|
||||
$Both,
|
||||
|
||||
[Parameter(Mandatory=$true, Position=3)]
|
||||
[scriptblock]
|
||||
$First,
|
||||
|
||||
[Parameter(Mandatory=$true, Position=4)]
|
||||
[scriptblock]
|
||||
$Second,
|
||||
|
||||
[Parameter(Mandatory=$true, Position=5)]
|
||||
[scriptblock]
|
||||
$Neither
|
||||
)
|
||||
|
||||
if ($Test1 -and $Test2)
|
||||
{
|
||||
return (&$Both)
|
||||
}
|
||||
elseif ($Test1 -and -not $Test2)
|
||||
{
|
||||
return (&$First)
|
||||
}
|
||||
elseif (-not $Test1 -and $Test2)
|
||||
{
|
||||
return (&$Second)
|
||||
}
|
||||
else
|
||||
{
|
||||
return (&$Neither)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
When-Condition -Test1 (Test-Path .\temp.txt) -Test2 (Test-Path .\tmp.txt) `
|
||||
-Both { "both true"
|
||||
} -First { "first true"
|
||||
} -Second { "second true"
|
||||
} -Neither { "neither true"
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
Set-Alias -Name if2 -Value When-Condition
|
||||
|
||||
if2 $true $false {
|
||||
"both true"
|
||||
} { "first true"
|
||||
} { "second true"
|
||||
} { "neither true"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue