|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 4096 (0x1000) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Set_Generic, seg_00eb05
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
package body Set_Generic is procedure Initialize (S : out Set) is begin S := null; end Initialize; function Is_Empty (S : Set) return Boolean is begin return S = null; end Is_Empty; procedure Make_Empty (S : in out Set) is begin S := null; end Make_Empty; procedure Init (Iter : out Iterator; S : Set) is begin Iter := Iterator (S); end Init; procedure Next (Iter : in out Iterator) is begin Iter := Iterator (Iter.Link); end Next; function Value (Iter : Iterator) return Element is begin return Iter.Value; end Value; function Done (Iter : Iterator) return Boolean is begin return Iter = null; end Done; procedure Copy (Target : in out Set; Source : Set) is Rest : Set := Source; begin Target := null; while Rest /= null loop Target := new Node'(Rest.Value, Target); Rest := Rest.Link; end loop; end Copy; function Is_Member (S : Set; X : Element) return Boolean is Rest : Set := S; begin while Rest /= null loop if Rest.Value = X then return True; end if; Rest := Rest.Link; end loop; return False; end Is_Member; procedure Add (S : in out Set; X : Element) is begin if not Is_Member (S, X) then S := new Node'(X, S); end if; end Add; procedure Delete (S : in out Set; X : Element) is Current : Set := S; Previous : Set := null; begin while Current /= null loop if Current.Value = X then if Previous /= null then Previous.Link := Current.Link; else S := Current.Link; end if; return; end if; Previous := Current; Current := Current.Link; end loop; end Delete; end Set_Generic;
nblk1=3 nid=0 hdr6=6 [0x00] rec0=2c rec1=00 rec2=01 rec3=02e [0x01] rec0=24 rec1=00 rec2=02 rec3=00c [0x02] rec0=08 rec1=00 rec2=03 rec3=000 tail 0x2170b5c308225427ef68e 0x42a00088462063203