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

⟦c67d803aa⟧ TextFile

    Length: 1558 (0x616)
    Types: TextFile
    Names: »B«

Derivation

└─⟦5829e5ed5⟧ Bits:30000534 8mm tape, Rational 1000, RCI 2_0_5
    └─ ⟦c9a165082⟧ »DATA« 
        └─⟦2162db02b⟧ 
            └─⟦this⟧ 

TextFile

package body List_Generic is

    function Nil return List is
    begin
        return null;
    end Nil;

    function Is_Empty (L : List) return Boolean is
    begin
        return L = Nil;
    end Is_Empty;

    function First (L : List) return Element is
    begin
        return L.First;
    end First;

    function Rest (L : List) return List is
    begin
        return L.Rest;
    end Rest;

    function Make (X : Element; L : List) return List is
    begin
        return new Listdata'(X, L);
    end Make;

    procedure Set_Rest (L : List; To_Be : List) is
    begin
        L.Rest := To_Be;
    end Set_Rest;

    procedure Set_First (L : List; To_Be : Element) is
    begin
        L.First := To_Be;
    end Set_First;

    procedure Free (L : in out List) is
    begin
        L := null;
    end Free;

    function Length (L : List) return Natural is
        Count : Natural := 0;
        Iter : Iterator;
    begin
        Init (Iter, L);
        while not Done (Iter) loop
            Count := Count + 1;
            Next (Iter);
        end loop;
        return Count;
    end Length;


    procedure Init (Iter : out Iterator; L : List) is
    begin
        Iter := Iterator (L);
    end Init;

    procedure Next (Iter : in out Iterator) is
    begin
        Iter := Iterator (Iter.Rest);
    end Next;

    function Value (Iter : Iterator) return Element is
    begin
        return Iter.First;
    end Value;

    function Done (Iter : Iterator) return Boolean is
    begin
        return Iter = null;
    end Done;

end List_Generic;