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 - metrics - download
Index: B T

⟦b051336d2⟧ TextFile

    Length: 3985 (0xf91)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Unchecked_Deallocation;

package body Generator_Of_V_Strings_And_Dyn_Values is

    procedure Dispose is new Unchecked_Deallocation (Integer, Value_Type);

    procedure Generate (Vector : in out Vector_Type) is
        Temp_Key : V_String;
        Temp_Val : Value_Type;
    begin
        for I in Vector'Range loop
            Vector (I).Key := To_V_String (I + Vector'Last);
            Vector (I).Val := new Integer'(I);
        end loop;
        for I in reverse Vector'Range loop
            if I mod 3 /= 0 then
                Replace (Temp_Key, Vector (Vector'First).Key, 1);
                Truncate (Temp_Key, Length (Vector (Vector'First).Key));
                Replace (Vector (Vector'First).Key, Vector (I).Key, 1);
                Truncate (Vector (Vector'First).Key, Length (Vector (I).Key));
                Replace (Vector (I).Key, Temp_Key, 1);
                Truncate (Vector (I).Key, Length (Temp_Key));
                Assign (Temp_Val, Vector (Vector'First).Val);
                Assign (Vector (Vector'First).Val, Vector (I).Val);
                Assign (Vector (I).Val, Temp_Val);
            end if;
        end loop;
    end Generate;

    procedure Generate2 (Vector : in out Vector_Type) is
        Temp_Key : V_String;
        Temp_Val : Value_Type;
    begin
        for I in Vector'Range loop
            Vector (I).Key := To_V_String (I + 21 * Vector'Last / 2);
            Vector (I).Val := new Integer'(I + 19 * Vector'Last / 2);
        end loop;
        for I in reverse Vector'Range loop
            if I mod 3 /= 0 then
                Replace (Temp_Key, Vector (Vector'First).Key, 1);
                Truncate (Temp_Key, Length (Vector (Vector'First).Key));
                Replace (Vector (Vector'First).Key, Vector (I).Key, 1);
                Truncate (Vector (Vector'First).Key, Length (Vector (I).Key));
                Replace (Vector (I).Key, Temp_Key, 1);
                Truncate (Vector (I).Key, Length (Temp_Key));
                Assign (Temp_Val, Vector (Vector'First).Val);
                Assign (Vector (Vector'First).Val, Vector (I).Val);
                Assign (Vector (I).Val, Temp_Val);
            end if;
        end loop;
    end Generate2;

    procedure Generate_Ascending (Vector : in out Vector_Type) is
    begin
        for I in Vector'Range loop
            Vector (I).Key := To_V_String (I + Vector'Last);
            Vector (I).Val := new Integer'(I);
        end loop;
    end Generate_Ascending;

    procedure Generate_Descending (Vector : in out Vector_Type) is
    begin
        for I in Vector'Range loop
            Vector (I).Key := To_V_String (2 * Vector'Last - I + Vector'First);
            Vector (I).Val := new Integer'(Vector'Last - I + Vector'First);
        end loop;
    end Generate_Descending;

    procedure Assign (Dest : in out V_String; Source : in V_String) is
    begin
        Replace (Dest, Source, 1);
        Truncate (Dest, Length (Source));
    end Assign;

    procedure Assign (Dest : in out String; Source : in String) is
    begin
        Dest := (others => ' ');
        Dest (1 .. Source'Length) := Source;
    end Assign;

    procedure Assign (Dest : in out Value_Type; Source : in Value_Type) is
    begin
        if Dest = Source then
            return;
        else
            Dispose (Dest);
            Dest := new Integer'(Source.all);
        end if;
    end Assign;

    procedure Destroy (Val : in out Value_Type) is
    begin
        Dispose (Val);
    end Destroy;

    function Equals (Left, Right : String) return Boolean is
    begin
        return Left = Right;
    end Equals;

    function Equals (Left, Right : Value_Type) return Boolean is
    begin
        return not (Left = null or Right = null) and then Left.all = Right.all;
    end Equals;

    function Less (Left, Right : String) return Boolean is
    begin
        return Var_String."<" (To_V_String (Left), To_V_String (Right));
    end Less;

end Generator_Of_V_Strings_And_Dyn_Values;