Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1 @@
S: String := Ada.Text_IO.Get_Line;

View file

@ -0,0 +1,5 @@
function F(X: Integer; Y: Integer := 0) return Integer; -- Y is optional
...
A : Integer := F(12);
B : Integer := F(12, 0); -- the same as A
C : Integer := F(12, 1); -- something different

View file

@ -0,0 +1,12 @@
type Integer_Array is array (Positive range <>) of Integer;
function Sum(A: Integer_Array) return Integer is
S: Integer := 0;
begin
for I in A'Range loop
S := S + A(I);
end loop;
return S;
end Sum;
...
A := Sum((1,2,3)); -- A = 6
B := Sum((1,2,3,4)); -- B = 10

View file

@ -0,0 +1,9 @@
function H (Int: Integer;
Fun: not null access function (X: Integer; Y: Integer)
return Integer);
return Integer;
...
X := H(A, F'Access) -- assuming X and A are Integers, and F is a function
-- taking two Integers and returning an Integer.

View file

@ -0,0 +1,3 @@
Positional := H(A, F'Access);
Named := H(Int => A, Fun => F'Access);
Mixed := H(A, Fun=>F'Access);