File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
courses/fundamentals_of_ada/080_expressions Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -26,37 +26,6 @@ Introduction
26
26
..
27
27
language_version 2012
28
28
29
- ----------
30
- Examples
31
- ----------
32
-
33
- .. code :: ada
34
-
35
- with GNAT.Random_Numbers; use GNAT.Random_Numbers;
36
- with Ada.Text_IO; use Ada.Text_IO;
37
- procedure Quantified_Expressions is
38
- Gen : Generator;
39
- Values : constant array (1 .. 10) of Integer := (others => Random (Gen));
40
-
41
- Any_Even : constant Boolean := (for some N of Values => N mod 2 = 0);
42
- All_Odd : constant Boolean := (for all N of reverse Values => N mod 2 = 1);
43
-
44
- function Is_Sorted return Boolean is
45
- (for all K in Values'Range =>
46
- K = Values'First or else Values (K - 1) <= Values (K));
47
-
48
- function Duplicate return Boolean is
49
- (for some I in Values'Range =>
50
- (for some J in I + 1 .. Values'Last => Values (I) = Values (J)));
51
-
52
- begin
53
- Put_Line ("Any Even: " & Boolean'Image (Any_Even));
54
- Put_Line ("All Odd: " & Boolean'Image (All_Odd));
55
- Put_Line ("Is_Sorted " & Boolean'Image (Is_Sorted));
56
- Put_Line ("Duplicate " & Boolean'Image (Duplicate));
57
- end Quantified_Expressions;
58
- .. include :: ../examples/080_expressions/quantified_expressions.rst
59
-
60
29
-----------------------------------------
61
30
Semantics Are As If You Wrote This Code
62
31
-----------------------------------------
You can’t perform that action at this time.
0 commit comments