DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦d7b9b5ce9⟧ TextFile

    Length: 6922 (0x1b0a)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Static_List_Generic;
with Text_Io;

package body Package_Static_List_Generic is

    package Static_List is new Static_List_Generic (20, Integer);


    procedure Display_Integer (The_Element : Integer; String_Before : String) is
    begin
        Text_Io.Put_Line (String_Before & "The_Integer => " &
                          Integer'Image (The_Element));
    end Display_Integer;

    procedure Display_List is new Static_List.Display (Display_Integer);

    procedure Test_Creation is
        use Text_Io;
        L  : Static_List.Object := Static_List.Null_Object;  
        L2 : Static_List.Object := Static_List.Null_Object;
    begin
        Put_Line ("-- Liste : 23 90 11 23 14 2 6 3 1");
        L := Static_List.Add (1, L);
        L := Static_List.Add (3, L);
        L := Static_List.Add (6, L);
        L := Static_List.Add (2, L);
        L := Static_List.Add (14, L);
        L := Static_List.Add (23, L);
        L := Static_List.Add (11, L);  
        L := Static_List.Add (90, L);
        L := Static_List.Add (23, L);
        Display_List (L);

        Put_Line ("-- Ajout de 11 elements");
        L := Static_List.Add (1, L);
        L := Static_List.Add (2, L);
        L := Static_List.Add (3, L);
        L := Static_List.Add (4, L);
        L := Static_List.Add (5, L);
        L := Static_List.Add (6, L);
        L := Static_List.Add (7, L);
        L := Static_List.Add (8, L);  
        L := Static_List.Add (9, L);
        L := Static_List.Add (10, L);
        L := Static_List.Add (11, L);
        Put_Line ("-- Liste pleine :");
        Put_Line ("Pleine (=TRUE) : " &
                  Boolean'Image (Static_List.Is_Full (L)));

        Put_Line ("-- Reste de la file (19 elements)");
        L2 := Static_List.Rest (L);
        Display_List (L2);

        Static_List.Set_First (L, 4);
        Put_Line ("-- First( Set_First(4)) (=4) : " &
                  Integer'Image (Static_List.First (L)));

        Put_Line ("-- Debordement de la file");
        L := Static_List.Add (10, L);  
        Put_Line ("-- Pas d'exception levee !?!");
    exception
        when Static_List.Full_Error =>
            Put_Line ("-- Exception levee");  
    end Test_Creation;


    procedure Test_Iterateur is  
        L    : Static_List.Object := Static_List.Null_Object;
        Iter : Static_List.Iterator;
        use Text_Io;
    begin  
        New_Line;
        Put_Line ("-- Creation Liste vide :");  
        Put_Line ("-- Vide (TRUE) : " &
                  Boolean'Image (Static_List.Is_Empty (L)));
        Display_List (L);
        New_Line;
        Put_Line ("-- Liste : 23 90 11 23 14 2 6 3 1");
        L := Static_List.Add (1, L);
        L := Static_List.Add (3, L);
        L := Static_List.Add (6, L);
        L := Static_List.Add (2, L);
        L := Static_List.Add (14, L);
        L := Static_List.Add (23, L);
        L := Static_List.Add (11, L);  
        L := Static_List.Add (90, L);
        L := Static_List.Add (23, L);
        New_Line;
        Put_Line ("-- Iterateur");
        Static_List.Init (Iter, L);
        while (not Static_List.Done (Iter, L)) loop
            Display_Integer (Static_List.Value (Iter, L), "--->");
            Static_List.Next (Iter, L);
        end loop;
    end Test_Iterateur;

    function Int_String (I : Integer) return String is
    begin
        return Integer'Image (I);
    end Int_String;


    procedure Test_Trie is
        L : Static_List.Object := Static_List.Null_Object;
        use Text_Io;
    begin
        declare
            procedure Trie       is new Static_List.Sort ("<" => Standard."<");  
            function  List_Image is
               new Static_List.Image (Separator => ",", Image => Int_String);
        begin
            Put_Line ("-- Liste : 23 90 11 23 14 2 6 3 1");
            L := Static_List.Add (1, L);
            L := Static_List.Add (3, L);
            L := Static_List.Add (6, L);
            L := Static_List.Add (2, L);
            L := Static_List.Add (14, L);
            L := Static_List.Add (23, L);
            L := Static_List.Add (11, L);  
            L := Static_List.Add (90, L);
            L := Static_List.Add (23, L);
            Put_Line
               ("-- Resultat attendu apres Trie : 1 2 3 6 11 14 23 23 90");
            New_Line;
            Trie (L);
            Display_List (L);
            Put_Line ("ENTEXTE : " & List_Image (L));  
        end;
    end Test_Trie;

    procedure Test_Compare is
        L1 : Static_List.Object := Static_List.Null_Object;
        L2 : Static_List.Object := Static_List.Null_Object;
        function Egal is new Static_List.Is_Equal (Is_Equal => Standard."=");
        use Text_Io;
    begin
        Put_Line ("-- Liste : 9 8 7 6 5 4 3 2 1");
        L1 := Static_List.Add (1, L1);
        L1 := Static_List.Add (2, L1);
        L1 := Static_List.Add (3, L1);
        L1 := Static_List.Add (4, L1);
        L1 := Static_List.Add (5, L1);
        L1 := Static_List.Add (6, L1);
        L1 := Static_List.Add (7, L1);  
        L1 := Static_List.Add (8, L1);
        L1 := Static_List.Add (9, L1);
        Put_Line ("-- Copie de liste");
        L2 := L1;
        Put_Line ("-- Test (TRUE) : " & Boolean'Image (Egal (L1, L2)));
        Put_Line ("-- Ajout d'un nombre dans une liste");
        L1 := Static_List.Add (10, L1);
        Put_Line ("-- Test (FALSE) : " & Boolean'Image (Egal (L1, L2)));
    end Test_Compare;


    procedure Test_Presence is
        L1 : Static_List.Object := Static_List.Null_Object;
        function Is_Into is new Static_List.Is_Element
                                   (Is_Equal => Standard."=");
        use Text_Io;
    begin
        Put_Line ("-- Liste : 9 8 7 6 5 4 3 2 1");
        L1 := Static_List.Add (1, L1);
        L1 := Static_List.Add (2, L1);
        L1 := Static_List.Add (3, L1);
        L1 := Static_List.Add (4, L1);
        L1 := Static_List.Add (5, L1);
        L1 := Static_List.Add (6, L1);
        L1 := Static_List.Add (7, L1);  
        L1 := Static_List.Add (8, L1);
        L1 := Static_List.Add (9, L1);
        Put_Line ("-- Test presence de 1 (TRUE) : " &
                  Boolean'Image (Is_Into (1, L1)));  
        Put_Line ("-- Test presence de 10 (FALSE) : " &
                  Boolean'Image (Is_Into (10, L1)));  
    end Test_Presence;


    procedure Test is
        use Text_Io;
    begin  
        New_Line;
        Put_Line ("---> Test package Static_List_Generic");
        New_Line;

        Put_Line ("-- Test de creation");
        Test_Creation;
        New_Line;

        Put_Line ("-- Test iterateur");
        Test_Iterateur;  
        New_Line;

        Put_Line ("-- Test trie");
        Test_Trie;
        New_Line;

        Put_Line ("-- Test comparaison");
        Test_Compare;
        New_Line;

        Put_Line ("-- Test presence");
        Test_Presence;
        New_Line;

    end Test;
end Package_Static_List_Generic;

pragma Main;