File: ada-expression-function.adb

package info (click to toggle)
geany 2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,300 kB
  • sloc: ansic: 168,600; cpp: 77,562; sh: 5,344; makefile: 1,694; cs: 1,233; javascript: 1,024; python: 580; f90: 537; vhdl: 504; sql: 503; lisp: 436; fortran: 389; php: 278; ada: 201; ruby: 163; java: 131; asm: 131; perl: 119; cobol: 88; tcl: 77; erlang: 73; xml: 66; ml: 27; sed: 16; pascal: 15; haskell: 6
file content (38 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
with Ada.Text_IO;	

procedure Test is

  My_Type : Boolean := True;

  procedure Tagged_Procedure is
    function Boolean_As_String return String is
      (case My_Type is
         when True  => "True Value",
         when False => "False Value");
	 
    function Another_Boolean_As_String return String is
      (case My_Type is when True  => "; function dummy0 return String is (",
         when False => "; function dummy1 return String is (");	      
    procedure p0 is	
    begin
        Ada.Text_IO.put ("-0");
    end p0;	 	 
    function Yet_Boolean_As_String return String is
      (case My_Type is
         when True  => "1",
         when False => "0");
    procedure p1 is	
    begin
        Ada.Text_IO.put ("-1");
    end p1;	 
  begin
    null;
  end Tagged_Procedure;

  procedure Not_Tagged_Procedure is
  begin
    null;
  end Not_Tagged_Procedure;
begin
  null;
end Test;