Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
6
Task/Function-prototype/Ada/function-prototype-1.ada
Normal file
6
Task/Function-prototype/Ada/function-prototype-1.ada
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
function noargs return Integer;
|
||||
function twoargs (a, b : Integer) return Integer;
|
||||
-- varargs do not exist
|
||||
function optionalargs (a, b : Integer := 0) return Integer;
|
||||
-- all parameters are always named, only calling by name differs
|
||||
procedure dostuff (a : Integer);
|
||||
5
Task/Function-prototype/Ada/function-prototype-2.ada
Normal file
5
Task/Function-prototype/Ada/function-prototype-2.ada
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
type Box; -- tell Ada a box exists (undefined yet)
|
||||
type accBox is access Box; -- define a pointer to a box
|
||||
type Box is record -- later define what a box is
|
||||
next : accBox; -- including that a box holds access to other boxes
|
||||
end record;
|
||||
4
Task/Function-prototype/Ada/function-prototype-3.ada
Normal file
4
Task/Function-prototype/Ada/function-prototype-3.ada
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
package Stack is
|
||||
procedure Push(Object:Integer);
|
||||
function Pull return Integer;
|
||||
end Stack;
|
||||
13
Task/Function-prototype/Ada/function-prototype-4.ada
Normal file
13
Task/Function-prototype/Ada/function-prototype-4.ada
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package body Stack is
|
||||
|
||||
procedure Push(Object:Integer) is
|
||||
begin
|
||||
-- implementation goes here
|
||||
end;
|
||||
|
||||
function Pull return Integer;
|
||||
begin
|
||||
-- implementation goes here
|
||||
end;
|
||||
|
||||
end Stack;
|
||||
8
Task/Function-prototype/Ada/function-prototype-5.ada
Normal file
8
Task/Function-prototype/Ada/function-prototype-5.ada
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
with Stack;
|
||||
procedure Main is
|
||||
N:integer:=5;
|
||||
begin
|
||||
Push(N);
|
||||
...
|
||||
N := Pull;
|
||||
end Main;
|
||||
Loading…
Add table
Add a link
Reference in a new issue