P. 1
Ada Programming

Ada Programming

|Views: 70|Likes:
Published by batfink_s

More info:

Published by: batfink_s on Jun 22, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/18/2011

pdf

text

original

Ada supports all six signature options but if you use the arguments' name as
option you will always have to name the parameter when calling the function.
i.e.:

Number_2 : Integer := Generate_Number (MinValue => 6,
MaxValue => 10);

Note that you cannot overload a generic procedure or generic function within the
same package. The following example will fail to compile:

package myPackage
generic

type Value_Type is (<>);

-- The first declaration of a generic subprogram
-- with the name "Generic_Subprogram"

procedure Generic_Subprogram (Value : in out Value_Type);
...

generic

type Value_Type is (<>);

-- This subprogram has the same name, but no
-- input or output parameters. A non-generic
-- procedure would be overloaded here.
-- Since this procedure is generic, overloading
-- is not allowed and this package will not compile.

procedure Generic_Subprogram;
...

generic

type Value_Type is (<>);

-- The same situation.
-- Even though this is a function and not
-- a procedure, generic overloading of
-- the name "Generic_Subprogram" is not allowed.

function Generic_Subprogram (Value : Value_Type) return Value_Type;

end myPackage;

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->