Christian Collberg
Department of Computer Science
University of Arizona
1#1
2#2
procedure Traverse_Tree;
procedure Increment(X : in out Integer);
procedure Right_Indent(Margin : out Line_Size);
procedure Switch(From, To : in out Link);
function Random return Probability;
function Min_Cell(X : Link) return Cell;
function Next_Frame(K : Positive) return Frame;
function Dot_Product(Left, Right : Vector)
return Real;
function "*"(Left, Right : Matrix) return Matrix;
procedure Print_Header(Pages : in Natural;
Header : in Line :=
(1 .. Line'Last => ' ');
Center : in Boolean := True);
-- Example of procedure body:
procedure Push(E : in Element_Type;
S : in out Stack) is
begin
if S.Index = S.Size then
raise Stack_Overflow;
else
S.Index := S.Index + 1;
S.Space(S.Index) := E;
end if;
end Push;
Traverse_Tree;
Print_Header(128, Title, True);
Switch(From => X, To => Next);
Print_Header(128, Header => Title,
Center => True);
Print_Header(Header=>Title,
Center=>True, Pages=>128);
--Examples of function calls:
Dot_Product(U, V)
Clock
-- Procedures with default expressions:
procedure Activate(
Process : in Process_Name;
After : in Process_Name:=No_Process;
Wait : in Duration := 0.0;
Prior : in Boolean := False);
procedure Pair(Left, Right :
in Person_Name:=new Person);
-- Examples of their calls: Activate(X); Activate(X, After => Y); Activate(X, Wait => 60.0, Prior => True); Activate(X, Y, 10.0, False); Pair; Pair(Left => new Person, Right => new Person);
procedure Put(X : in Integer);
procedure Put(X : in String);
procedure Set(Tint : in Color);
procedure Set(Signal : in Light);
-- Examples of their calls:
Put(28);
Put("no possible ambiguity here");
Set(Tint=>Red); -- Set(Red) is ambiguous.
Set(Signal=>Red); -- Red can denote either
Set(Color'(Red)); -- a Color or a Light
function "+" (Left,Right:Matrix) return Matrix; function "+" (Left,Right:Vector) return Vector; -- assuming that A, B, and C are of -- the type Vector the following two -- statements are equivalent: A := B + C; A := "+"(B, C);