Created
March 1, 2013 06:17
-
-
Save joseph-montanez/5062788 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma License (Gpl); | |
pragma Ada_2012; | |
with Ada.Text_IO; | |
procedure App is | |
package I_IO is new Ada.Text_IO.Integer_IO (Integer); | |
function Add (X : in Integer; Y : in Integer) return Integer | |
with | |
Pre => X > 5, | |
Post => Add'Result > 5; | |
A : Integer; | |
B : Integer; | |
function Add (X : in Integer; Y : in Integer) return Integer | |
is | |
begin | |
return X + Y; | |
end Add; | |
begin | |
A := 1; | |
B := 1; | |
Ada.Text_IO.Put ("Output: "); | |
I_IO.Put (Add (A, B)); | |
return; | |
end App; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project App is | |
for Source_Dirs use ("."); | |
for Main use ("app.adb"); | |
package Builder is | |
for Default_Switches ("ada") use ("-gnatVa", "-gnatwa", "-gnaty", "-g"); | |
end Builder; | |
package Compiler is | |
for Default_Switches ("ada") use ("-gnatVa", "-gnatwa", "-gnaty", "-g"); | |
end Compiler; | |
end App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment